How to handle long running jobs that are posted to a service bus with only 5min peek lock

StackOverflow https://stackoverflow.com/questions/22291274

  •  12-06-2023
  •  | 
  •  

Pergunta

What do people tend to do when they have a design that put jobs on a service queue or topic that takes longer then the 5min max of peeklock?

I have been using the OnMessage(...) async messagepump of service bus and is wondering if thats not such a good idea after also since if I start moving the jobs to a table while processing them, then the messagepump will just empty the queue and I just have the problem elsewhere of making sure my jobs are scheduled even between servers.

Foi útil?

Solução

If you have a long running message processing workflow the you can check the lockedUntilUtc property of the message and call RenewLock at the appropriate time.

http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.servicebus.messaging.brokeredmessage.renewlock.aspx

in the next release of SDK the OnMessage processing loop will automatically do that for you so that convenience API is always a good idea to use.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top