1

I am using MassTransit with RabbitMQ.

Here's a summary of what happens.

  1. ORDER SERVER which is an application that gets orders and publishes (with MassTransit) Order message.

  2. PROCESSING UNIT which is an application that consumes Order message and do some process on it and then publishes OrderProcessed.

so here PROCESSING UNIT is both consuming and publishing.

In blogs, documentation and forums I read that every app has to have a queue for itself, I did that but still bunch of messages (approximately %30) will go to error queue and WHEN I do it with two queues on PROCESSING UNIT it works just fine. (means processing unit has one IServiceBus with different queue just for consuming, and another one just for publishing)

I was wondering if my design is right. I feel like it shouldn't be like this.

Thanks,

Peyman

4

2 回答 2

1

每个进程可以有多个总线(每个都绑定到自己的队列),实际上这是确保队列不被一个消费者的消息类型垄断的推荐方法。

在这种情况下,使用 DI 配置总线可能会很棘手,因为您必须明确指定总线实例和每个服务的消费者之间的绑定。

将它们拆分为单独的应用程序/服务可能更容易,但我知道部署和配置可能很麻烦。

但是,“发布队列”没有意义。就像 Travis 所说,将详细信息发布到小组中,您会在那里获得很多帮助。

于 2013-07-03T12:24:52.407 回答
1

您应该只需要一个IServiceBus用于在单个进程中发布和使用。你的容器里是IServiceBus单例吗?我建议收集一些示例代码(比如你如何设置你的IServiceBus)并将其提供给邮件列表https://groups.google.com/forum/?fromgroups#!forum/masstransit-discuss。如果没有更多信息,很难提供解决方案。

于 2013-07-03T03:01:59.963 回答