Configured service bus topic with a subscription which has MaxDeliveryCount set to 10 and DeadLetterQueue.. For the same service bus topic have created a service bus topic trigger. In the service bus topic trigger forcibly setting the exception to make the message as Abandon.
However message is going to DeadLetterQueue without reaching MaxDeliveryCount. Service Bus Topic Trigger is not getting triggered for Abandon messages until it reaches MaxDeliveryCount. Is PeekLock behavior is not available for Service Bus Topic Trigger?
Code for Service Bus Topic Trigger;
using System;
using System.Threading.Tasks;
publicstaticasync Task Run(string mySbMsg, Int32 DeliveryCount,string MessageId,TraceWriter log)
{
try
{
log.Info($"C# Azure Service Bus Topic trigger function saved file: {mySbMsg} ");
log.LogInformation($"DeliveryCount: {DeliveryCount}");
await SampleFunction(log);
}
catch(Exception ex)
{
log.Info($"Exception: {ex} ");
throw ;
}
}
publicstaticasync Task SampleFunction(TraceWriter log)
{
log.Info($"C# Azure Service Bus Topic trigger function SampleFunction: ");
thrownew ArgumentNullException("argument");
}