通过Rhino的Rhino服务总线.队列——发送消息出错

本文关键字:Rhino 出错 消息 队列 服务 总线 通过 | 更新日期: 2023-09-27 18:18:29

当我尝试从测试项目发送消息时,我得到一个错误,这是异常消息

找不到C2C.RhinoUtil.EventServiceBus的消息所有者在Rhino.ServiceBus.Impl.MessageOwnersSelector.GetEndpointForMessageBatch(对象[]defaultservicebus . send (Object[]消息)C2C.Infraestructura.Aspect.EventDispatcherAspect.Intercept (IInvocation调用)f: '四面八方' C2C ' Desarrollo '树干' ' EventDispatcherAspect.cs C2C.Infraestructura '方面:行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;
}

基本上我拦截所有的事务并尝试通知到另一个后端应用程序,但是

在test方法中创建

通过Rhino的Rhino服务总线.队列——发送消息出错

问题在测试项目的app.config上,您必须将总线名称设置为实体名称空间,如下所示

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

" C2C的地方。"RhinoUtil"是在消息

中发送的类"EventServiceBus"的命名空间。