我们有一个使用 NServicebus 的本地 Web 应用程序,我们希望将队列移动到 azure(作为完全基于云的更大迁移路径的一部分)。我正在尝试建立 POC,但似乎无法使其正常工作。
我有以下配置:
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" />
<section name="AzureQueueConfig" type="NServiceBus.Config.AzureQueueConfig, NServiceBus.Azure"/>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core"/>
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core"/>
</configSections>
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
<AzureQueueConfig QueueName="timeoutmanager"
ConnectionString="DefaultEndpointsProtocol=https;AccountName=<My storage account>;AccountKey=<My primary access key>"/>
<UnicastBusConfig TimeoutManagerAddress="timeoutmanager">
<MessageEndpointMappings>
<add Messages="TechFu.Services.Bus.Messages.Publishing.CMS.SitePagePublishMessage, TechFu.Services.Bus.Messages" Endpoint="sitepagepublish" />
</MessageEndpointMappings>
在我的应用程序中,我将总线配置为:
Configure.WithWeb()
.StructureMapBuilder()
.InMemorySubscriptionStorage()
.AzureMessageQueue()
.JsonSerializer()
.UnicastBus()
.LoadMessageHandlers()
.IsTransactional(true)
.CreateBus()
.Start();
当我尝试发布到队列时,我收到以下消息:
The destination queue 'sitepagepublish@ DefaultEndpointsProtocol=https;AccountName=<My storage account>;AccountKey=<My primary access key>’ could not be found. You may have misconfigured the destination for this kind of message (TechFu.Services.Bus.Messages.Publishing.CMS.SitePagePublishMessage) in the MessageEndpointMappings of the UnicastBusConfig section in your configuration file. It may also be the case that the given queue just hasn't been created yet, or has been deleted.
我有点不知所措,我尝试了我在网上找到的几个不同的样本,但我觉得我缺乏天蓝色的知识正在妨碍我。我从这个问题中提取了大部分配置:nservicebus on-premise host using azure Queue 难道我缺少一些魔法?