我有一些服务,我希望能够从中发布和订阅消息。
我有一个后端总线控制台应用程序,它具有以下配置:
<configSections>
<section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
</configSections>
<castle>
<facilities>
<facility id="rhino.esb">
<bus
threadCount="1"
numberOfRetries="5"
endpoint="rhino.queues://localhost:50001/SonaTribeESB_Backend"
name="backend"/>
<messages />
</facility>
</facilities>
并使用:
QueueUtil.PrepareQueue("backend");
_container = new WindsorContainer().AddFacility<WcfFacility>().Install(Configuration.FromAppConfig());
_container.Register(Component.For<IWindsorContainer>().Instance(_container));
Console.WriteLine("Backend: Starting to listen for incoming messages ...");
var host = new DefaultHost();
host.Start<BackendBootStrapper>();
Console.ReadLine();
然后我有一个 WCF 服务,它具有以下 esb 配置:
<facilities>
<facility id="rhino.esb" >
<bus
threadCount="1"
numberOfRetries="5"
endpoint="rhino.queues://localhost:50002/SonaTribeESB_AccountClient"
name ="AccountClient"/>
<messages>
<add
name="Messages"
endpoint="rhino.queues://localhost:50001/SonaTribeESB_Backend" />
</messages>
</facility>
</facilities>
以及 global.asax 中的以下内容:
Container.Install(Configuration.FromAppConfig());
Container.Kernel.AddFacility("rhino.esb", new RhinoServiceBusFacility());
var bus = Container.Resolve<IStartableServiceBus>();
bus.Start();
然后是具有以下配置的第二个服务:
<facilities>
<facility id="rhino.esb" >
<bus
threadCount="1"
numberOfRetries="5"
endpoint="rhino.queues://localhost:50003/SonaTribeESB_EventClient"
name ="EventClient"/>
<messages>
<add
name="Messages"
endpoint="rhino.queues://localhost:50001/SonaTribeESB_Backend" />
</messages>
</facility>
</facilities>
但是每当我尝试使用这个向总线发送消息时:
_serviceBus.Send(new Esb.Messages.Account.EventAttendanceToggleMessage
{
AccountProxy = eventAttendanceRequest.Account,
EventProxy = eventAttendanceRequest.EventInstance,
Attending = attending
});
我收到以下错误:
找不到 SonaTribe.Esb.Messages.Account.EventAttendanceToggleMessage 的消息所有者
有人知道我在做什么错吗?