nservicebus on-premise host using azure Queue

萝らか妹 提交于 2019-12-05 22:25:11

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.

I haven't used nServiceBus but it sounds like Azure Service Bus would be your best option here for Hybrid communication between on-premises and Azure.

You could use ServiceBus Queues or be more intelligent about your model and do pub/sub via Topics and Subscriptions.

In this example you could have your Web Role write to a queue/topic and then have an on-premises consumer read from the queue/topic via a REST(.NET API). (see example in the link below)

Check out a link to the MSDN on them: http://msdn.microsoft.com/en-us/library/windowsazure/hh367516.aspx

Of course maybe asking Udi Dahan what is the best way forward might also be a good idea :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!