-
Notifications
You must be signed in to change notification settings - Fork 217
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
PubSub subsequent messages not properly ordered by key #753
Comments
@rriolobos I have updated your sample code a bit to try to reproduce and created two samples:
Ordering seems to work as expected on my end. Can you review a couple of things (ranked from most to less likely) as the message ordering seems to work for me:
Hope that helps shed some light. I have not tested letting |
Hi @skymeyer, First of all thanks for your answer. You are right, I mean, when I set MaxOutstandingMessages=1 messages are properly ordered. In fact, all messages are ordered, both for same key and different one. Let's try with an example: A,B,C,A,A I expect the following output; I mean, hope messages with different key are processed concurrently and messages with same key are processes sequentially. The output I'm obtaining: After first A ack, A messages order is not kept anymore. Even more, if I send B,B after previos sequence, they are also processed concurrently instead on sequential as expected. Is it possible to get this behavior based on some specific settings? When testing this scenario with a receiver using directly the PubSub Receive() method, the output obtained is the expected one. Next you can see the code:
Best regards. |
I believe the linked PR corrected this issue with the corresponding config set on the transport instance. Closing, please reopen if this was not solved. |
sdk-go/protocol/pubsub/v2/protocol.go
Line 233 in 7601392
I tested pubsub ordering key with this library but I found an issue. When you send 3 or more messages, with same ordering key, receiver only waits for first one, second and third messages are consumed concurrently. I added a 5 second sleep in message handler in order to check that the total amount of time was 15 seconds as expected, but it was 10 second. It can also be checked with logs. When I try the same directly invoking pubsub receiver, it worked as expected (@skymeyer).
The text was updated successfully, but these errors were encountered: