I have added a project in my visual studio solution which is a service bus topic trigger function. I am running application with default code but facing problem. Whenever I am adding message to service bus topic, my trigger executes 5-6 times per message and last it get following error.
Error
The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue.
My code:
[FunctionName("TopicFunction1")]
public static void Run(
[ServiceBusTrigger("myservicebustopicname", "subscriptionname", Connection = "ServiceBus_NS_ConnectionString")]string message,
Int32 deliveryCount,
ILogger log)
{
log.LogInformation($"ServiceBus topic trigger function processed message: {message}");
}
Delivery count is reaching to 5-6.
I checked multiple questions related to this issue and they are not helpful. One example is below. Azure Function App Azure Service Bus trigger triggers twice
Please help on this.