NServiceBus需要在不同环境中进行显式消息注册

时间:2012-11-01 17:43:39

标签: nservicebus

我在所有environemnts中运行Windows 7 64位。通过包含我的两个程序集隐式注册所有消息在开发中工作,但QA和Prod需要显式注册,否则NService在启动时抛出异常。 有没有人遇到类似问题,你有解决方案吗?

例外

Source:NServiceBus.Core System.InvalidOperationException - No destination could be found for message type
xyz.Application.Claims.Messaging.IGlassWorkflowEventMessage. Check the <MessageEndpointMapping> section of the configuration 
of this endpoint for an entry either for this specific message type or for its assembly.
Stack:   at NServiceBus.Unicast.UnicastBus.Subscribe(Type messageType, Predicate`1 condition)
at CEI.Application.Claims.GlassSubscriber.SubscriberEndpointStartup.Run() in c:\xyz\tfs\Claimslink\DEV\Bus\GlassSubscriber\Config\SubscriberEndpointStartup.cs:line 36
at NServiceBus.Host.Internal.ConfigManager.<>c__DisplayClass1.<Startup>b__0()

我的配置条目

<!--This works in my development environment-->
<MsmqTransportConfig InputQueue="GlassSubscriber" ErrorQueue="GlassSubscriberError" NumberOfWorkerThreads="1" MaxRetries="2"/>
<UnicastBusConfig>
<MessageEndpointMappings>

  <!--Just add assemblies, all messages recognized -->
  <add Messages="xyz.shared.impl" Endpoint="msgsvcpubinputqueue"/>
  <add Messages="xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>
</MessageEndpointMappings>
</UnicastBusConfig>


 <!--QA and Production always require explicit message registrations??-->
 <MsmqTransportConfig InputQueue="GlassSubscriber" ErrorQueue="GlassSubscriberError" NumberOfWorkerThreads="1" MaxRetries="2"/>
 <UnicastBusConfig>
<MessageEndpointMappings>
  <add Messages="xyz.shared.impl" Endpoint="msgsvcpubinputqueue"/>
  <add Messages="xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>

  <!--We have dozens of messages, explicitly registering for each subscriber is a pain-->

  <add Messages="xyz.Application.Claims.Messaging.IGlassWorkflowEventMessage, xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>
  <add Messages="xyz.Application.Claims.Messaging.GlassWorkflowEventMessage, xyz.Claims.impl" Endpoint="msgsvcpubinputqueue"/>
</MessageEndpointMappings>
 </UnicastBusConfig>

0 个答案:

没有答案