我已经让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”上运行。
答案 0 :(得分:0)
找出问题:问题出现了,因为机器名称的nslookup指向了错误的IP地址 - 这是因为DHCP为机器分配了不同的IP,但dns条目需要一段时间才能更新。