Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Azure service bus subscription: How do I delete the message when I receive a MessageLockLostException?

$
0
0

Hi,

We are receiving a MessageLockLostException when we try to execute

brokeredMessage.Complete();

on a message received by a subscription. I checked for possible causes for this and came up with information here which states that the lock duration on a subscription cannot be set. If a process is unable to complete a message within 5 minutes, then the lock is released.

My requirement is that if I have reached till "brokeredMessage.Complete();" then I have essentially finished processing a message and my worker should not process it again.

Is there any way this can be achieved? Say I catch the MessageLockLost exception, is there a way to delete the message from the subscription? I also read something about renewing the lock here, but that pertains to a service bus queue. Can I do something similar to this without spawning another thread?

Thanks,

Nikhil


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>