gpt4 book ai didi

configuration - 本地 NServicebus 发布到 Azure 队列

转载 作者:行者123 更新时间:2023-12-04 18:22:31 25 4
gpt4 key购买 nike

我们有一个使用 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=&lt;My storage account&gt;;AccountKey=&lt;My primary access key&gt;’ 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.



我有点不知所措,我尝试了在网上找到的几种不同的示例,但我觉得我缺乏 azure 知识成为了障碍。我从这个问题中提取了大部分配置:nservicebus on-premise host using azure Queue我是否缺少一些魔法?

最佳答案

目标队列是否存在? NServiceBus 默认情况下仅创建源队列,因此如果目标不存在,它不会为您创建它。

关于configuration - 本地 NServicebus 发布到 Azure 队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10374129/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com