为什么NServiceBus在Azure上不能用我指定端点的名字吗? [英] Why does NServiceBus on Azure not use my specified endpoint name?
问题描述
我有一个使用NServiceBus发布一条消息,一个蓝色的主题的控制台应用程序。然而,NServiceBus创建一个具有不同名称的新课题,而不是我指定的。这是为什么?
I have a console app that uses NServiceBus to publish a message to an Azure topic. However, NServiceBus creates a new topic with a different name, instead of the one I specified. Why is this?
详细信息
我的消息组态如下所示。这意味着,输入'TheResponse的消息应该去一个话题的名字,测试1吧?
My message configuration looks as follows. This means that messages of Type 'TheResponse' should go to a Topic with the name, "test1", right?
<UnicastBusConfig>
<MessageEndpointMappings>
<add Assembly="Messages" Type="Messages.TheResponse" Endpoint="test1"/>
</MessageEndpointMappings>
</UnicastBusConfig>
<connectionStrings>
<add name="NServiceBus/Transport"
connectionString="Endpoint=sb://[my-namespace].servicebus.windows.net/;SharedSecretIssuer=[issuer];SharedSecretValue=[key]"></add>
</connectionStrings>
会发生什么事在现实中是NServiceBus格式创建在Azure上一个新的主题的 MyAssemblyName-MyMachineName.events
我们使用的Azure服务总线传输。
We use the Azure Service Bus transport.
我怎么NServiceBus将事件发布到特定的主题?难道我误解了MessageEndpointMappings的目的是什么?
How do I get NServiceBus to publish events to a specific Topic? Do I misunderstand the purpose of the MessageEndpointMappings?
推荐答案
天青servicebus不允许命名不同类型具有相同名称的多个实体,因此每个端点定义端点的名称和发布主题命名的输入队列与.events追加。
Azure servicebus does not allow to name multiple entities of different types with the same name, so each endpoint defines an input queue named after the endpoint name and a publishing topic with '.events' appended.
您不能发布到特定的主题,一个终端只能在它自己的主题,用户可以发布决定来听特定端点。
You cannot publish to a specific topic, an endpoint can only publish on it's own topic and subscribers can decide to listen to specific endpoints.
您映射文件实际上是说,所有的消息/类型Messages.TheResponse的命令应该被发送到端点的测试1输入队列,或者情况下TheResponse将是一个事件:请订阅端点的发布主题测试1
Your mapping file actually says, all messages/commands of type Messages.TheResponse should be sent to the input queue of endpoint 'test1', or in case that TheResponse would be an event: please subscribe to the publishing topic of endpoint 'test1'
这篇关于为什么NServiceBus在Azure上不能用我指定端点的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!