Rhino.Esb“找不到”的消息所有者

发布于 2024-10-15 07:46:31 字数 2880 浏览 2 评论 0原文

我有一些服务,我希望能够发布和订阅消息。

我有一个后端总线控制台应用程序,它具有以下配置:

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我入戏太深 2024-10-22 07:46:31

这个问题实际上与 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文