Hi
There is a specific point regarding ordering key that I don't understand.
After a message is being published - Will subscriber with ordering key receive and process the message only after previous message with the same ordering key is acknowledged/nacked/delay is over? Or it is not waiting?
Let's assume we have 1 subscription.
Message A is being published. Subscription "gets the message", and it's started to be processed.
2 seconds later, while message A is still being processed - Message B is published to the topic (with the same ordering key).
Should I expect message B will start to be processed immedately? Or it will start to be processed only after message A is "done"?
Hi @Shayke4747,
Welcome to Google Cloud Community!
As quoted from the Pub/Sub documentation:Within-key ordering:
Messages published with the same ordering key are expected to be received in order. Assume that for ordering key A, you publish messages 1, 2, and 3. With ordering enabled, 1 is expected to be delivered before 2 and 2 is expected to be delivered before 3.
Ideally for the same ordering key, Message B should not be processed immediately if Message A is still outstanding to the subscriber. Messages will be delivered in the order they were published.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi @marckevin
WDYM by "ideally"?
Just to verify - You say that it is not guaranteed that message B will be processed only after message A is acked? I understand that "Messages will be delivered in the order they were published", but this doesn't allow me to verify the processing is done in the correct order