usrere
usrere

Reputation: 93

Azure Service Bus in Azure Function

I'm using Service Bus trigger in Azure Functions v2.0. In the previous version i have used Brokered Message and there are no problems with this. But as i moved to v2.0 i need to use Message instead of Brokered Message. And once i called

await queueClient.CompleteAsync(message.SystemProperties.LockToken);

i get an exception which says:

The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue, or was received by a different receiver instance. I have configured my Queue Client as follows:

var queueClient = new QueueClient(serviceBusString, MessageQueueName);

Does anyone face this issue? Are there any workarounds ?

Upvotes: 0

Views: 215

Answers (1)

Sean Feldman
Sean Feldman

Reputation: 25994

Incoming messages that trigger Function execution are automatically completed when function is done. You do not need to complete those messages yourself. The exception you see is indicating that.

Upvotes: 1

Related Questions