GCP Cloud Pub/Sub message ordering guide when using Spring Boot with async subscription
I've looked through the documentation and I'm still confused about I've encountered a strange issue with I'm working with a important scenario with message ordering in GCP Cloud Pub/Sub while using Spring Boot's async subscription feature... Despite enabling the 'orderingKey' in my Pub/Sub topic, messages aren't being processed in the expected order. For instance, when I publish messages with the same ordering key, they appear to be delivered out of order to my subscribers. Hereโs a snippet of how Iโm publishing messages: ```java String orderingKey = "my-ordering-key"; PubsubMessage message = PubsubMessage.newBuilder() .setData(ByteString.copyFromUtf8("My message")) .setOrderingKey(orderingKey) .build(); publisher.publish(message); ``` Iโve confirmed that the topic is set up with ordering enabled and that my subscription is using the same ordering key. On the subscriber side, Iโm using the Spring Cloud GCP library version 2.0.0, with the following configuration: ```yaml spring: cloud: gcp: pubsub: subscriber: subscriber-name: my-subscriber async: true ``` I also tried setting the `maxOutstandingMessages` property in the subscriber configuration to see if that would help with the ordering: ```yaml max-outstanding-messages: 10 ``` However, I still notice that the order of the messages is inconsistent. Sometimes, I see messages processed in the correct order, but other times they arrive out of sequence. Iโve verified that there's no other processing that could affect the order. Any suggestions on what might be going wrong or how to better configure the subscriber to ensure strict ordering? Thanks in advance! I recently upgraded to Java 3.11. Thanks for taking the time to read this!