Bird
0
0

Given a Pub/Sub topic with message ordering enabled and messages published with ordering key 'A' in this sequence: M1, M2, M3. If M2 fails to publish, what happens to M3?

medium📝 Predict Output Q4 of 15
GCP - Cloud Pub/Sub

Given a Pub/Sub topic with message ordering enabled and messages published with ordering key 'A' in this sequence: M1, M2, M3. If M2 fails to publish, what happens to M3?

AM3 is delivered immediately, ignoring M2
BM3 is delayed until M2 is successfully published
CM3 is dropped and never delivered
DM3 is delivered before M1
Step-by-Step Solution
Solution:
  1. Step 1: Understand ordering key behavior

    Messages with the same ordering key must be delivered in order.
  2. Step 2: Analyze failure impact

    If M2 fails, M3 waits until M2 is published to maintain order.
  3. Final Answer:

    M3 is delayed until M2 is successfully published -> Option B
  4. Quick Check:

    Ordering key blocks next message on failure [OK]
Quick Trick: Next message waits if previous with same key fails [OK]
Common Mistakes:
  • Assuming messages skip failed ones
  • Thinking messages with same key arrive out of order
  • Believing messages get dropped silently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes