nservicebus-用路由器配置Azurestoragequeuetransport(需要明确定义的序列化器,但我不能这样做)

发布于 2025-01-25 13:51:44 字数 988 浏览 2 评论 0 原文

我正在尝试设置路由器,以将消息从Azure存储队列运输到RabbitMQ运输。我能够配置RabbitMQ接口&可以很好地连接。但是,当我尝试启动路由器时,我会从nservicebus出现一个错误,说“使用'endpointConfiguration.serialization();''选择一个序列化器。”这与我的 azurestoragequeuetransport 接口注册有关。根据NserviceBus文档,Azurestoragequeuetransports需要明确定义的序列化器()。但是,在lambda中给我的预定义对象似乎没有办法实现此目的(它是类型 type> code> toxtraptextextions< azurestoragequequeuetransport> ):

routerConfig.AddInterface<AzureStorageQueueTransport>("AzureStorageQueue", t =>
{
    t.ConnectionString(_settings.CloudBusSettings.TransportConnectionString);
    t.SerializeMessageWrapperWith<NewtonsoftSerializer>();
});

方法 code> serializeizemessageagewrapperwith&lt;&gt;&gt;&gt; (); 是我能找到的唯一可配置的序列化设置。它无法从上面有或没有此功能调用的同一错误消息开始。我找不到任何使用Azurestoragequeuetransport和路由器的示例。我不确定如何解决这个问题。感谢任何建议。

I'm trying to setup a Router to route messages from an Azure Storage Queue Transport to a RabbitMQ transport. I'm able to configure the RabbitMQ interface & connect just fine. However, when I try to start the router I get an error from NServiceBus stating "Use 'endpointConfiguration.UseSerialization();' to select a serializer." This is related to my AzureStorageQueueTransport interface registration. According to the NServiceBus docs, AzureStorageQueueTransports require an explicitly defined serializer (https://docs.particular.net/transports/azure-storage-queues/). However, the pre-defined object given to me in the lambda doesn't appear to have a way to achieve this (it's of type TransportExtensions<AzureStorageQueueTransport>):

routerConfig.AddInterface<AzureStorageQueueTransport>("AzureStorageQueue", t =>
{
    t.ConnectionString(_settings.CloudBusSettings.TransportConnectionString);
    t.SerializeMessageWrapperWith<NewtonsoftSerializer>();
});

The method SerializeMessageWrapperWith<>(); is the only configurable serialization setting I can find. It fails to start with the same error message above with or without this function call. I cannot find any example that uses AzureStorageQueueTransport with a router. I'm not sure how to fix this. Appreciate any suggestions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

五里雾 2025-02-01 13:51:44

事实证明,这是Nuget版本控制问题。我最初使用nservicebus 7.2.0与nservicebus.Router&amp; nservicebus.router.connector版本3.7.1。

一旦我升级了NserviceBus.Router&amp; nservicebus.router.connector到其最新版本(在撰写本文时3.10.0) - 这也需要使用Nservicebus&gt; = 7.4.0,我能够启动路由器而不会出错。

不确定为什么它很重要,因为我的原始设置都是兼容的,但它起作用

Turns out it was a NuGet versioning issues. I was originally using NServiceBus 7.2.0 with NServiceBus.Router & NServiceBus.Router.Connector versions 3.7.1.

Once I upgraded NServiceBus.Router & NServiceBus.Router.Connector to their latest versions (3.10.0 at the time of writing this) - this also required use of NServiceBus >= 7.4.0, I was able to start the router without error.

Not sure why it mattered as my original setup was all compatible, but it works

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文