Hello!
I'm working with a service bus that triggers an Azure Function. In each invocation of the Azure function, I need to process the received message.
I've noticed that if my Azure function throws an error, the message's deliveryCount is automatically incremented by 1.
Now, what I want to achieve is to call the abandonMessage
function without throwing an exception. However, I've encountered some challenges.
I attempted to use contex.binding.data.messageReceiver
, but it appears to be an empty object.
I also tried creating a helper function that creates a receiver and then calling receiver.abandonMessage(message)
. The issue I encountered here is that the message type required by abandonMessage
is ServiceBusReceivedMessage
, whereas the message I receive in my function is the object I initially placed into the service bus. As a result, it lacks the necessary properties for the ServiceBusReceivedMessage
type.
Is there a way to abandon or mark the message as completed without throwing an exception?
Is it possible to touch the ServiceBuseSender/Receiver created by Azure when using Service Bus as trigger and binding?