google-cloud-rust icon indicating copy to clipboard operation
google-cloud-rust copied to clipboard

Messages delivered out-of-order despite enable_message_ordering set.

Open ryzhyk opened this issue 1 year ago • 2 comments

Thanks for this very useful crate!

I am not sure if the following problem is caused by something I am doing wrong, a bug in this crate, or an issue in the Pub/Sub service itself.

I create a subscription with enable_message_ordering set to true. I publish several messages to the topic with the same ordering key using the publisher API. However, when I read from the subscription using the Subscription::subscribe API, messages occasionally appear out of order in the resulting stream. I have confirmed that the enable_message_ordering flag is set for the subscription and that the messages have correct ordering key in the Google Cloud Console.

Interestingly, this only seems to happen when the subscription has a filter configured.

Any ideas what could be going on? Thanks!

ryzhyk avatar Aug 22 '24 20:08 ryzhyk

PS. I've also confirmed that messages appear in the correct order when I pull them from the Google Console instead of via the API.

ryzhyk avatar Aug 22 '24 20:08 ryzhyk

Currently, I have set up a filter in my environment with subscription and run it for a day, but I have not been able to confirm any cases where the order is broken.

Since the filter operation is completed in Cloud Pub/Sub, it is unlikely that the problem is caused by crates.

What happens if I subscribe to other language libraries, for example google-cloud-go, for the relevant subscriptions?

yoshidan avatar Aug 25 '24 08:08 yoshidan