简体   繁体   中英

Azure web job to just peak/"react on" and not process service bus queue message

I've created an azure web job which gets trigger on service bus queue messages. When i run the web job it processes the messages from the service bus queue, som my simple question is as follows;

Is there a way to make the web job just trigger on the new message delivered to the queue without processing it rendering the message complete and removed from the queue?

I am currently using "Servicebustrigger" to trigger the queue in my function class.

public void Processservicebus([ServiceBusTrigger("%Values:QueueName%", AutoCompleteMessages = false, Connection = "ServiceBusConnection")] string myQueueItem, ILogger log)
{
    log.LogInformation(myQueueItem);
    var testGetConfig = _configuration.GetValue<string>("Values:QueueName");
}

A function triggered by the Service Bus message will process a message. That's what it's designed for. Wherever configured to auto-complete or not, messages will be either gone from the queue (completed) or dead-lettered (auto-completion turned off) after N number of processing attempts specified by the queue's MaxDeliveryCount setting.

For what your asking for, pure notification about messages existence and processing by something other than function, you'll need to review your design.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM