我已经让 PubSub 示例与中间的分销商合作 - 所有这些都在我的本地计算机上。现在我正试图让分销商在另一台机器上遇到问题。订阅者似乎是通过分发者向发布者注册的(我在发布者中添加了日志语句,它告诉我订阅者的数量并给了我正确的值),但订阅者只是没有得到任何发布的事件。我究竟做错了什么?我需要为不同的队列提供一些权限吗?这是我的配置文件:
出版商:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
</configSections>
<MsmqTransportConfig InputQueue="MyPublisherInputQueue" ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" />
<UnicastBusConfig DistributorControlAddress=""
DistributorDataAddress=""
ForwardReceivedMessagesTo="">
<MessageEndpointMappings>
<add Messages="MyMessages" Endpoint="distributorDataBus@rosmi" />
</MessageEndpointMappings>
</UnicastBusConfig>
</configuration>
订户:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
</configSections>
<MsmqTransportConfig
InputQueue="Subscriber1InputQueue_1"
ErrorQueue="error"
NumberOfWorkerThreads="1"
MaxRetries="5"
/>
<UnicastBusConfig DistributorControlAddress="distributorControlBus@rosmi" DistributorDataAddress="distributorDataBus@rosmi">
<MessageEndpointMappings>
<add Messages="MyMessages" Endpoint="MyPublisherInputQueue" /> <!-- I've also tried this with MyPublisherInputQueue@rrajagop -->
</MessageEndpointMappings>
</UnicastBusConfig>
</configuration>
经销商:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="NumberOfWorkerThreads" value="1"/>
<add key="DataInputQueue" value="distributorDataBus"/>
<add key="ControlInputQueue" value="distributorControlBus"/>
<add key="ErrorQueue" value="error"/>
<add key="StorageQueue" value="distributorStorage"/>
<add key="NameSpace" value="http://www.UdiDahan.com"/>
<!-- relevant for a Serialization of "interfaces" or "xml" -->
<add key="Serialization" value="xml"/>
<!-- can be either "xml", or "binary" -->
</appSettings>
</configuration>
在上述配置中,分发者运行在名为“rosmi”的机器上,发布者和订阅者运行在“rrajagop”上。