1
votes

I am working on azure service bus. Actually, my service bus queue is processing one message 3 times. my lock time of message is 5 minutes. Every message is processing max of 2 mins but i didn't know why the queue is picking same message and sending to processing and the duplicate messages are picking after 5 mins only.

lock time duration is 5mins.

Can anyone please help me.

Thanks in advance.

1

1 Answers

1
votes

With Azure Service Bus messages will be re-processed when a message is not actioned by the receiving party. An action would be completing, deferring, dead-lettering. If you don't have any of those, once LockDuration on the broker side expires, the message will be re-delivered. Additional situation when a message would be re-delivered w/o waiting for LockDuration to time out would be to abandon a message. Then a message is picked up right away by the next request for new messages.

You should share your code to provide enough context. Messages can be received manually using MessageReceiver.ReceiveAsync() or using user-callback API. For the first option you have to action messages (complete for example). For the other option, there's a configuration API where you could opt-out of auto-completion and would be required manually complete message passed into user-callback.