Reputation:
We are receiving a message from Azure Service Bus Queue. The receiver (message handler) on the queue, calls an Application Service, which updates a Million+ records in a SQL Database table, process takes more than 30 min.
Does Azure service bus queue have a timeout limit? Will this cause SQL Table process to stop updating rows?
The actual Service Bus Message queue which is being Sent is pretty small, its just a Year
and ProductType
. Then the app service method will take the two parameters, and update the whole sql table.
Azure Service Bus Queue Method ---> Service Bus Message Receives (Event Handler) ---> Calls App Service to Update SQL Table
Upvotes: 7
Views: 7149
Reputation: 6508
Short Answer: In Peek-Lock receive mode max lock duration supported is 5 minutes.
Now the long answer :)
There are 2 modes of the Service Bus message receiver.
For long-running operation, one technique is to renew the lock with lesser interval than lock duration. In the example you are following, you can set MaxAutoRenewDuration property in MessageHandlerOptions which can automatically renew for you.
The other technique could be leveraging Message deferral feature where you start your processing on receive, but keep on deferring the message retrieval until your process is complete at which point you receive the message and complete. Slightly complex, but a smart way.
Upvotes: 11