我正在尝试设置路由器,以将消息从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.
发布评论
评论(1)
事实证明,这是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