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

OnMessage & AutoComplete=true & PeekLock. Message redelivery logic

$
0
0

Hello All,

I have a scenario where I have a number of worker roles which each run assorted jobs.

Inside each worker role, I have service bus client(s) set up with an OnMessage delegate with AutoComplete=true and using  PeekLock.

The docs say auto complete means that when the delegate returns, the message will then be completed.

My question is, do I need to worry about renewing the lock? what if my 'job' (and therefore delegate) takes longer than the maximum lock (as I understand it) of 5 minutes?

I have read in loads of places that the message pump system (Onmessage) has lots of logic inside it to make things easier - does it renew locks as they are required?

I am getting messages with a delivery count of >1 and am currently ignoring them, but in order to recover from a crash process, I need to actually run these jobs again.  Can I rely on OnMessage to do this for me? Or will the message be available on the queue again even though the delegate is still running?

I hope this question makes sense, and thank you for any help in advance.

Regards,

Matt Dendle



Viewing all articles
Browse latest Browse all 1916

Trending Articles



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