Reputation: 17657
New to Azure, I wrote an azure function that is triggered when message arrives to service bus queue. Do I need to remove this message manually or is this handled by service bus?
Upvotes: 14
Views: 6983
Reputation: 333
The messages in Service Bus can be received either in peek lock mode or receive and delete mode. When the message is received in peek lock mode,the message is not deleted from the queue.But when it is received in receive and delete mode the message is automatically received and removed from the Queue. So removing the message depends on the mode of receive you have performed Azure functions receive messages in peek-lock mode,so if the complete() is called,the message will be removed from the queue
Upvotes: 0
Reputation: 15621
No, you don't have to remove the message manually when you're using a Service Bus trigger:
The Functions runtime receives a message in PeekLock mode. It calls
Complete
on the message if the function finishes successfully, or callsAbandon
if the function fails. If the function runs longer than thePeekLock
timeout, the lock is automatically renewed as long as the function is running.
Source: Trigger - PeekLock behavior
Upvotes: 13