Reputation: 1315
I've got a service bus topic triggered function which gets triggered whenever some data is pushed to the topic.
The function looks something like this:
[FunctionName("funcGetServiceBusEntities")]
public async Task Run([ServiceBusTrigger("sbtopic", "sbsub", Connection = "ServiceBusConnectionString")]Message message, MessageReceiver messageReceiver, [DurableClient] IDurableOrchestrationClient starter, ILogger log)
{
// perform processing on the data
//...
//...
// Complete since we don't want to process the message again
await messageReceiver.CompleteAsync(message.SystemProperties.LockToken);
//...
}
I' m not sure why I'm getting this error:
Microsoft.Azure.ServiceBus: The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue. Reference:ab88d42f-5fed-4392-983a-921cc6eab776, TrackingId:7664c851-9f29-4b4f-a334-4038e0921810_B11, SystemTracker:sb-dev:Topic:sbtopic|sbsub, Timestamp:2020-03-31T12:09:32.
Is the implementation of CompleteAsync
wrong?
Upvotes: 3
Views: 6709
Reputation: 14093
This is what you faced now:
Please notice that after triggered the message will be removed. So you don't need to tag it and don't worry about process the message again. It has already been removed.
Upvotes: 2