0

I am using azure service bus topics and subscriptions for messages processing. Messages are getting pulled by windows application using api. I am using peek-lock for 5 minutes when getting messages. Now if suppose windows app gets the messages from azure and after getting it app crashes. Now again when I opens the app messages are not getting from api. This is because messages are locked for 5 min. When it automatically unlocked by azure then I am able to get messages again from azure.

I cannot unlock, locked messages from azure because of the crash.

So how can I get the messages again quickly without waiting for automatic unlock by azure. So if due to some reason app get crash then I can get messages again quickly on app launch.

Please help me how to solve this issue.

1 Answers1

1

In this instance, it would be better to use a short lock duration, and renew the lock while you are processing. For example set a lock duration for 60 seconds and renew it every 45 seconds while you are working on the message. That way if something crashes, it would be a maximum of 60 seconds before picking up a failed message.

JTaub
  • 1,273
  • 11
  • 16