Database Reference
In-Depth Information
Azure support for NServiceBus
Let's work with the MSMQ publish/subscribe example that we have worked with multiple
times. There will have to be multiple steps for either the Azure service bus or Azure queues
to be used with NServiceBus. These steps include:
1. A reference for the NuGet reference for NServiceBus transport needs to be in-
stalled for Azure Service Bus; we use NSer-
viceBus.Azure.Transports.WindowsAzureServiceBus, http://www.nuget.org/pack-
ages/NServiceBus.Azure.Transports.WindowsAzureServiceBus/ , and for the Azure
queue, we use NServiceBus.Azure.Transports.WindowsAzureStorageQueues, ht-
tp://www.nuget.org/packages/NSer-
viceBus.Azure.Transports.WindowsAzureStorageQueues/ .
2. The app.config or web.config needs to contain the new NServiceBus/
Transport configuration. For the Azure Service bus, it will be of the form:
<connectionStrings>
<add name="NServiceBus/Transport"
connectionString="Endpoint=sb://{namespace}.servicebus.windows.net/
;SharedSecretIssuer=owner;SharedSecretValue={key}" />
</connectionStrings>
For the Azure queue, it will be of the form:
<connectionStrings>
<add name="NServiceBus/Transport"
connectionString="UseDevelopmentStorage=true" />
</connectionStrings>
3. The transport of the IBus needs to change appropriately. For the Azure service bus,
the transport needs to be set to UseTransport<AzureServiceBus>() . For
Azure queues, the transport needs to be set to UseTransport<AzureStor-
ageQueue>() .
By running the NServiceBus video store example for the Azure queues found at ht-
tps://github.com/Particular/NServiceBus.Azure.Samples/tree/master/
VideoStore.AzureStorageQueues.Cloud , and creating the videostore-sales queue to
write to, we can see that the transport queues are created in a similar manner as NSer-
viceBus would do for MSMQ.
Search WWH ::




Custom Search