nservicebus导通$ P采用蔚蓝色的队列$ pmise主机 [英] nservicebus on-premise host using azure Queue

查看:176
本文介绍了nservicebus导通$ P采用蔚蓝色的队列$ pmise主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来,与附带的所有示例项目的 nServicebus 的是设置在发送端和主机是Web角色和辅助角色(并通过角色切入点主办)。

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角色发送消息 - >在premise主机处理的消息

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

是否有可能在premise主机配置为使用Azure的队列存储只(不MSMQ)?

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.

推荐答案

是的,这是可能的,你只需要指定传输初始化总线时:

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();

有关文档的一部分,我建议你在github上看看:的https: //github.com/NServiceBus/NServiceBus/tree/master/Samples/Azure

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

请注意,大部分这些样本是为了在Windows Azure上运行,因此使用 AzureConfigurationSource 的。当你在premise运行,因为它使用从RoleEnvironment设置这是不行的。不要使用 AzureConfigurationSource 在premise时。

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.

这篇关于nservicebus导通$ P采用蔚蓝色的队列$ pmise主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆