通过 rhino.queues 的 Rhino 服务总线 - 发送消息时出错

Rhino Service Bus via rhino.queues - error sending messages

我在尝试从测试项目发送消息时遇到错误, 这是异常消息

Could not find a message owner for C2C.RhinoUtil.EventServiceBus at Rhino.ServiceBus.Impl.MessageOwnersSelector.GetEndpointForMessageBatch(Object[] messages) at Rhino.ServiceBus.Impl.DefaultServiceBus.Send(Object[] messages) at C2C.Infraestructura.Aspect.EventDispatcherAspect.Intercept(IInvocation invocation) in f:\Proyectos\C2C\Desarrollo\Trunk\C2C.Infraestructura\Aspect\EventDispatcherAspect.cs:line 44

这是我的测试配置app.config(这就像一个向中央应用程序发送消息的客户端)

<rhino.esb>
<bus threadCount="1" numberOfRetries="5" endpoint="rhino.queues://localhost:50002/RhinoServiceBusTest" name="client" />
<messages>
  <add name="messagges" endpoint="rhino.queues://localhost:50001/RhinoServiceBusBackend" />
</messages>
<assemblies>
  <add assembly="Rhino.ServiceBus.RhinoQueues" />
</assemblies>

这是我的后端配置

<rhino.esb>
<bus threadCount="1" numberOfRetries="5" endpoint="rhino.queues://localhost:50001/RhinoServiceBusBackend" name="backend" />    
<assemblies>
  <add assembly="Rhino.ServiceBus.RhinoQueues" />
</assemblies>

这是我发送消息的代码的一部分

QueueUtil.PrepareQueue("client");

var host = new DefaultHost();
host.Start<ClientBootStrapper>();

//Console.WriteLine("Client 1: Hit enter to send message");
//Console.ReadLine();

var bus = host.Bus as IServiceBus;

var eventSB = new EventServiceBus();
eventSB.Nombre = methodName;
eventSB.Service = invocation.TargetType.FullName;
eventSB.Data = (arguments as BusinessEntity).UnProxy(); ;

try
{
    bus.Send(eventSB);
}
catch (Exception)
{

    throw;
}

基本上我会拦截所有交易并尝试通知另一个后端应用程序,但是

根据我创建的测试方法

问题出在测试项目的app.config上,你必须像实体命名空间一样设置总线名称,像这样

<messages>
  <add name="C2C.RhinoUtil" endpoint="rhino.queues://localhost:50001/RhinoServiceBusBackend" />
</messages>

其中 "C2C.RhinoUtil" 是消息中发送的我的 class "EventServiceBus" 的名称空间