Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nservicebus on-premise host using azure Queue

It appears that all the sample projects that ship with nServicebus are setup where the sender and host are web roles and worker roles (and hosted via role entry point).

I have a need to do something like this:

Web Role sends message --> On Premise Host handles message

Is it possible to configure an on premise Host to use Azure Queue storage only (and not MSMQ)?

I can't seem to find a single example of this documented anywhere.

like image 256
chutch Avatar asked Nov 22 '25 14:11

chutch


1 Answers

Yes this is possible, you simply have to specify the transport when initializing the Bus:

   var config = Configure.With()
                 .SpringBuilder()
                 .AzureConfigurationSource() <--- Don't use this when working on premise.
                 .XmlSerializer()
                 .UnicastBus()
                 .LoadMessageHandlers()
                 .AzureQueuesTransport()  <--- Configure Azure Storage Queues
                 .IsTransactional(true)
                 .PurgeOnStartup(false)
                 .InMemorySubscriptionStorage();

For the documentation part, I suggest you take a look on github: https://github.com/NServiceBus/NServiceBus/tree/master/Samples/Azure

Note that most of these samples are meant to run in Windows Azure, hence the use of the AzureConfigurationSource. This won't work when you're running on premise since it uses settings from the RoleEnvironment. Don't use AzureConfigurationSource when working on premise.

like image 130
Sandrino Di Mattia Avatar answered Nov 25 '25 11:11

Sandrino Di Mattia