Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Max Delivery Count with Azure Service Bus Topic Trigger

$
0
0

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");
}

 

 

Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>