paolosalvatori / ServiceBusExplorer

The Service Bus Explorer allows users to connect to a Service Bus namespace and administer messaging entities in an easy manner. The tool provides advanced features like import/export functionality or the ability to test topic, queues, subscriptions, relay services, notification hubs and events hubs.
MIT License
1.99k stars 578 forks source link

Receive and Delete behaviour can have side effects #590

Open skastberg opened 2 years ago

skastberg commented 2 years ago

During troubleshooting I found out how Receive and Delete works, When I select a higher value for Top than current Queue length I received the messages and inspected. In the background new messages that arrive are Received and deleted until the top value is reached. The messages that arrive later will never get to the UI and will "disappear". If you select ALL the loop will continue until the application is exited. I assume it is intentional but it can have side effects. In my case I did runs in batches and sometimes messages disappeared without explanation, until I got Enlighted. What happens if someone troubleshoots in production without knowing?

Now I know and aware of it, that said would it be better to change behavior to get up to current queue length?

ErikMogensen commented 2 years ago

HI Samuel,

That does not sound good. I tried to reproduce the issue but for me the issue did not occur. When looking at the code I don't see how this could happen: https://github.com/paolosalvatori/ServiceBusExplorer/blob/40852ea2beb6c1203f54da4754b71928b44123ee/src/ServiceBusExplorer/Controls/HandleQueueControl.cs#L1311-L1328

Since this is doing the dirty Receive and Delete, do you think this could be due to messages getting lost between the Service Bus service and the Service bus SDK? That is before it reaches the application code.

skastberg commented 2 years ago

Hi Erik,

Thanks for looking in to it. I did a bit more testing with different connections as you say it works on your side. It seems to be when using AMQP. Tested AMQP with both the old and the new client and both give this behavior. If I connect with NetMessaging it works. It's really strange I debugged and as you say it should not happen.

ErikMogensen commented 2 years ago

Samuel, I updated the WindowsAzure.Servicebus NuGet package to the latest version. It has been merged into the develop branch. Please try again and see if the issue persists. If it does it would be great if you created a case for this since many people will start using the AMQP transportmode to utilize the new large message support.

yomotoya commented 1 year ago

Hi @ErikMogensen , could you please tell me current status of this issue? I can repro the issue on the latest version 5.0.14. I found a PullRequrest you made: https://github.com/paolosalvatori/ServiceBusExplorer/pull/591 Will be the issue fixed on 5.1.0 release? If so, when is 5.1.0 going to be released? Thanks!

ErikMogensen commented 1 year ago

@yomotoya, @skastberg told me #591 didn't help with this issue. Since then we have updated WindowsAzure.ServiceBus again. 5.0.14 is using WindowsAzure.ServiceBus 6.2.2 which is the latest version,

So I don't have a solution. It looks like a bug in WindowsAzure.ServiceBus. However, I heard WindowsAzure.ServiceBus is unable to handle messages larger than 1 MB. If that's true then this may not be worth it. Why are you using AMQP?