-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] Messages from Sessions are not FIFO when you abandon #30027
Comments
Hi @KnyGoo, This is a know issue: #24064. The root cause has been addressed and I am working on a fix for the ordering issue when session number bigger than 1. Can I know your receiver configurations, like prefetchCount, maxConcurrentSessions? (It will be better if you can provide the repro code snippet) |
Hi @liukun-msft , Thank you for the quick response. We are using Azure Service Bus in a professional environment and this is a major issue for us. Some example code to reproduce:
Output (we try 3 times): |
Hi @KnyGoo, Thanks for providing the repro code. I'll check it and keep you updated. |
Hi @KnyGoo |
Hi @liukun-msft , Will this issue also be fixed for maxConcurrentSessions > 1? Setting this to 1 in production environment will limit troughput.... At this moment we cofigure our service bus as follow:
|
Hi @KnyGoo Can I know some background of how you create sessions and whether they are stable? As a walkaround, you can create multiple threads and use |
Hi @liukun-msft , You suggest creating ServiceBusSessionReceiverAsyncClient in an endless loop? Isn't this the reason why we are using processor instead of receiver? What if we loose connection, we should handle this ourselves? Our use case: |
Hi @KnyGoo Processor is definitely recommended for your case. However, because the fix for session process ordering issue is still in progress and may take some time for testing, if you don't want to wait, I think one possible solution is to use Once issue #27336 is solved, you can switch to the processor. And I'll keep you updated for our progress. |
This is a part of this work #33688 and work is still in progress. |
Resolving this. Refer https://learn.microsoft.com/en-us/azure/developer/java/sdk/troubleshooting-messaging-service-bus-overview#upgrade-to-715x for details about version 7.15.x and how to opting-in new session rework. |
Describe the bug
When we receive multiple messages from one session, but at one point we abandon one of these messages. The messages are not consumed FIFO anymore
Exception or Stack Trace
2022-07-19 18:08:52.303 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message 9d0be482-dca9-4b93-b07b-b81e65c1f6f8 from all-to-documentfactoryservice.job
2022-07-19 18:08:52.323 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 1
2022-07-19 18:08:53.390 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message e74b2cb6-3076-4fab-af00-15df5f1628b2 from all-to-documentfactoryservice.job
2022-07-19 18:08:53.390 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 2
2022-07-19 18:08:54.460 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message 2dc4f7fe-1ab7-4b08-8d1f-b02e35ea7518 from all-to-documentfactoryservice.job
2022-07-19 18:08:54.461 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 3
2022-07-19 18:08:55.496 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message 3007f257-76f8-43d7-b996-4e30a3cd4c09 from all-to-documentfactoryservice.job
2022-07-19 18:08:55.496 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 4
2022-07-19 18:08:56.530 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message 9d0be482-dca9-4b93-b07b-b81e65c1f6f8 from all-to-documentfactoryservice.job
2022-07-19 18:08:56.530 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 1
2022-07-19 18:08:57.563 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message e74b2cb6-3076-4fab-af00-15df5f1628b2 from all-to-documentfactoryservice.job
2022-07-19 18:08:57.563 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 2
2022-07-19 18:08:58.600 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message 2dc4f7fe-1ab7-4b08-8d1f-b02e35ea7518 from all-to-documentfactoryservice.job
2022-07-19 18:08:58.600 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 3
2022-07-19 18:08:59.733 INFO 19388 --- [oundedElastic-2] b.s.c.a.servicebus.ProcessorContainer : Received message 3007f257-76f8-43d7-b996-4e30a3cd4c09 from all-to-documentfactoryservice.job
2022-07-19 18:08:59.733 INFO 19388 --- [oundedElastic-2] b.s.c.a.processor.SessionQueueDemo : Received message from session queue: 4
To Reproduce
Send multiple messages with same session id. Abandon the message when receiving.
Expected behavior
Messages should still be FIFO
Setup (please complete the following information):
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: