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
2.02k stars 588 forks source link

Repair and resubmit message stuck #708

Closed michaelhaggren closed 1 year ago

michaelhaggren commented 1 year ago

It seems that my Service Bus Explorer application got stuck somehow when trying to perform the "Repair and resubmit message" from the dead-letter queue, it worked fine for the first 400 messages but then it just randomly stopped working, taking 3 minutes trying to resend a single message and then giving me the error "No message was moved. ~~". It works fine when doing it straight from the Azure Portal but it does not work from the application. Tried to change lock duration, increasing the delivery count and checking logs but nothing seems to work. It is the "Topics" i am using.

This is the error i am receiving, first i got this error aswell but it at least sent all the messages it could, now it doesnt send any messages.

image

Any suggestions?

ErikMogensen commented 1 year ago

This is due to limitations in the Service Bus service. If you uncheck the "Remove message from DLQ" it will be able to resend the messages since it won't have to lock them. That will cause the messages to remain in the DLQ though.

Is the Portal Service Bus Explorer able to remove messages when resubmitting them?

If you want to remove the messages from the DLQ while resending you can try the following. The best thing is to delete older messages from the DLQ. You can also increase the Lock duration to the maximum, which is five minutes. Another thing to try is to run Service Bus Explorer from a VM in the same region as the topic. If you are using a namespace in the Standard tier you may get better results at different hours of the day since in that case you share the hardware with other tenants.

michaelhaggren commented 1 year ago

Yes the Portal Service Bus Explorer is able to remove them from the Dead-letter queue, the application was aswell but randomly stopped working.

I tried increasing the Lock duration but that did not work. When you mean "older messages" from the DLQ, do you mean from weeks back or longer?

Would really like to know/investigate why this happend so randomly, i guess i could do it the way u proposed with just unchecking it and send out the remaining messages to be sure they were sent out but would really like to also remove them from the DLQ to make sure there are only defected messages in the DLQ.

ErikMogensen commented 1 year ago

I just checked in the portal service bus explorer and I couldn't find a way to remove messages while resending. Are you sure that it is possible and if so - how?

When you mean "older messages" from the DLQ, do you mean from weeks back or longer?

I meant the messages that are older than the one you are trying to resend. The reason for this is that Service bus explorer has to retrieve and lock every message that is older than the message you want to resend. That is why it is taking such long time. It is not beautiful, but the best way I could come up with given the limitations of the service.

michaelhaggren commented 1 year ago

The way I did it was to resend all the emails manually and then completing them manually which removed them from the queue. It is not optimal as you have to keep track on the sequence ids so you don't remove any messages that's yet to be sent. Took a while but did the trick.