Google Cloud Professional Cloud Developer — Question 269

You recently developed an application that monitors a large number of stock prices. You need to configure Pub/Sub to receive a high volume messages and update the current stock price in a single large in-memory database. A downstream service needs the most up-to-date prices in the in-memory database to perform stock trading transactions. Each message contains three pieces or information:
• Stock symbol
• Stock price
• Timestamp for the update

How should you set up your Pub/Sub subscription?

Answer options

Correct answer: A

Explanation

The correct answer is A, as a pull subscription with exactly-once delivery ensures that messages are processed only once and can handle high volumes without duplicating updates. Options B and D lack exactly-once delivery, which could lead to outdated prices being processed multiple times. Option C, while having exactly-once delivery, uses a push subscription, which may not be ideal for high-volume scenarios where control over message retrieval is necessary.