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?
ReceiveDisabled: You can send messages to the queue, but you can't receive messages from it. You'll get an exception if you try to receive messages to the queue. Change the queue status in the Azure portal: In the Azure portal, navigate to your Service Bus namespace.
The "AzureWebJobsServiceBus" app setting. The ServiceBusQueueTrigger annotation allows you to create a function that runs when a Service Bus queue message is created. Configuration options available include queue name and connection string name.
The following Java function uses the @ServiceBusQueueTrigger annotation from the Java functions runtime library to describe the configuration for a Service Bus queue trigger. The function grabs the message placed on the queue and adds it to the logs. Java functions can also be triggered when a message is added to a Service Bus topic.
Once CancelScheduledMessageAsync method is called for the schedule message, schedule message will be deleted from the queue: Running the above sample code, you should be able to peek/delete all the scheduled messages from Azure service bus. Hope this helps!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With