Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message ordering seems broken starting with 5.0.1 #2649

Closed
ls-urs-keller opened this issue Mar 1, 2024 · 5 comments
Closed

Message ordering seems broken starting with 5.0.1 #2649

ls-urs-keller opened this issue Mar 1, 2024 · 5 comments
Labels
priority: p2 type: bug Something isn't working

Comments

@ls-urs-keller
Copy link

ls-urs-keller commented Mar 1, 2024

Describe the bug
When switching from 5.0.0 to 5.0.1 there seems to be a problem with message ordering.
The problem is present in 5.0.1, 5.0.2, 5.0.3 and 5.0.4.

We are using Spring 3.2.3, Spring cloud 2023.0.0, java 21

Sample
I have created a demonstrator project here: https://github.com/ls-urs-keller/pubsub-message-ordering-problem
It has multiple maven profiles that allow you to run:

  • the broken version (5.0.1)
  • the working version (5.0.0)
  • a version with a workaround (5.0.1 + google-cloud-pubsub-bom pinned to version 1.125.13 which was used in 5.0.0)

Please refer to the readme.md of the project

@burkedavison
Copy link
Member

This issue looks very similar to a recently resolved pubsub client issue: googleapis/java-pubsub#1889

@ls-urs-keller : When I tried replicating with your project using the production service (not the emulator), I got the following error due to the @Autowired PubSubTemplate:

java.lang.IllegalStateException: Cannot publish a message with an ordering key when message ordering is not enabled in the Publisher client. Please create a Publisher client with setEnableMessageOrdering(true) in the builder.

When I manually created the PubSubTemplate with a PublisherFactory that set factory.setEnableMessageOrdering(true);, I wasn't able to replicate the error.

Have you ensured that the publisher being created by the Autowired PubSubTemplate in your example is enabling message ordering?

@burkedavison burkedavison added type: bug Something isn't working priority: p2 labels Mar 5, 2024
@ls-urs-keller
Copy link
Author

ls-urs-keller commented Mar 15, 2024

@burkedavison I'm setting the property spring.cloud.gcp.pubsub.publisher.enable-message-ordering" in the code here: https://github.com/ls-urs-keller/pubsub-message-ordering-problem/blob/main/src/test/java/com/lightspeedhq/pubsubmessageorderingproblem/PubSubOrderingIntegrationTest.java#L81
Maybe the bug is simply that this property is no longer picked up or was replaced by a different one.

@burkedavison
Copy link
Member

I've created a ticket in the java-pubsub repository to see if someone from that team can take a look.

@burkedavison
Copy link
Member

@ls-urs-keller : Feedback from the maintainers of Pub/Sub:

This was an issue that required an update in the Pub/Sub emulator that was fixed in version 0.8.12 of the Pub/Sub emulator. Could you ask the customer to upgrade their version of the emulator?

@ls-urs-keller
Copy link
Author

@burkedavison Thank you. I can confirm bumping the emulator container to gcr.io/google.com/cloudsdktool/google-cloud-cli:467.0.0-emulators or higher solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants