randomdatascientist
randomdatascientist

Reputation: 611

Are pub/sub messageIds the same for duplicates?

This is a simple question that isn't answered in the documentation - if a pubsub message is redelivered, is the messageId the same as the original attempt or does it change with each subsequent delivery attempt?

Upvotes: 1

Views: 1711

Answers (1)

John Hanley
John Hanley

Reputation: 81434

There are two types of delivery. Publish to a topic and delivery to a subscriber.

The publish can result in duplicate messages with unique message IDs.

Once a message is successfully published to a topic, delivery retries will have the same message ID.

Also, note that Pub/Sub guarantees at least once delivery for every subscription. This means that a message may be delivered more than once by the same subscription. These duplicate messages will have the same message ID.

Reference: Handling duplicate data in streaming pipelines using Dataflow and Pub/Sub

Upvotes: 6

Related Questions