Rhino.Esb“找不到”的消息所有者
我有一些服务,我希望能够发布和订阅消息。
我有一个后端总线控制台应用程序,它具有以下配置:
<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 没有消息所有者
有人知道我做错了什么吗?
I have some services which i want to be able to publish and subscribe to messages from.
I have a backend bus console app which has the following configuration:
<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>
and is fired using:
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();
I then have a WCF service which is has the following esb config:
<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>
And the following in the global.asax:
Container.Install(Configuration.FromAppConfig());
Container.Kernel.AddFacility("rhino.esb", new RhinoServiceBusFacility());
var bus = Container.Resolve<IStartableServiceBus>();
bus.Start();
And then a second service with the following config:
<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>
But whenever I try to send a message to the bus using this:
_serviceBus.Send(new Esb.Messages.Account.EventAttendanceToggleMessage
{
AccountProxy = eventAttendanceRequest.Account,
EventProxy = eventAttendanceRequest.EventInstance,
Attending = attending
});
I get the following error:
Could not find no message owner for SonaTribe.Esb.Messages.Account.EventAttendanceToggleMessage
Anyone got any idea what i'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题实际上与 IoC 容器中的 RavenDb DocumentStore 应用了不正确的生活方式有关!固定的。
The problem with this was actually to do with the incorrect lifestyle being applied to the RavenDb DocumentStore in the IoC container! fixed.