Azure Webjobs SDK Extension for Azure ServiceBus
Introduction
This extension will enable recept of all messages on every subscription in a single Topic instead of needing to know the subscription name ahead of time like with [ServiceBusTrigger]
Once referenced you can enable it on the JobHostConfiguration
object.
var config = new JobHostConfiguration()
config.UseTopicTriggers();
var host = new JobHost(config);
host.RunAndBlock();
It supports
- JSON serialized POCO objects
- DataContractSerializer POCO objects
- BrokeredMessages
- Streams
And decorate each function like this:
public static void MyFunction([TopicTrigger("my_topic")] POCO messages)
This way you will only need to implement one function to receive all subscriptions messages, instead of one function per subscription as is the case with the [ServiceBusTrigger]
.
Built-in pipelines
As of v0.3, the built in processors were gathered into their own NuGet package to prevent duplicate work.
Our use case
We use Azure Service Bus to load balance the processing of Microsoft Dynamics CRM data into an Azure SQL DB. Each subscription represents a single logical entity inside of a remoteexecutioncontext. Each entity can be independently processed, but must be processed in order.
Tracing
Tracing can be turned on by adding in
<switches>
<add name="Pandora.Azure.WebJobs.Extensions.TopicTrigger" value="Verbose" />
</switches>
<sources>
<source name="Pandora.Azure.WebJobs.Extensions.TopicTrigger" />
</sources>
Installation
You can obtain it through Nuget with:
Install-Package Pandora.Azure.WebJobs.Extensions.TopicTrigger
Or clone this repo and reference it.