Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure WebJob ServiceBusTrigger for Sessions

I know it's possible to recieve messages from a service bus queue like:

public static void ProcessQueueMessage([ServiceBusTrigger("inputqueue")] string message, TextWriter logger)

But is there also a way to to receive a session via a trigger attribute? Something like ServiceBusSessionTrigger?

Normally one would accept a session like this:

var session = queueClient.AcceptMessageSession();

But I'd prefer the WebJob SDK to handle how multiple sessions at once can be processed.

Edit: Seems that this currently isn't supported: see github for feature request

Edit 2: Seems they are working on this

like image 940
Zenuka Avatar asked Jun 11 '15 06:06

Zenuka


People also ask

How do I trigger Service Bus queue in Azure?

Right-click on the project and click on project -> Click on Add -> Select New Azure Function. Select Azure function and give it a name and click on Add button. Now select Service Bus Queue Trigger and specify queue name and click on Add button. That's it -- our Service Bus trigger function is created.

What is difference between Queue and Topic in Azure Service Bus?

A queue allows processing of a message by a single consumer. In contrast to queues, topics and subscriptions provide a one-to-many form of communication in a publish and subscribe pattern. It's useful for scaling to large numbers of recipients.


1 Answers

this nuget Microsoft.Azure.WebJobs.Extensions.ServiceBus in 3.1.0-beta3 version support session in azure function. when you install this nuget, you will be able to use it like the code below [ServiceBusTrigger("testsessionqueue", Connection = "serviceBusConnectionString", IsSessionsEnabled = true)]

there you can find nuget : Nuget and it's a github issue: github

Please bear in mind that it's still a beta

like image 83
Pawel Haracz Avatar answered Oct 05 '22 11:10

Pawel Haracz