Question

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

Was it helpful?

Solution

You can have more than one bus per process (each tied to itsown queue), in fact it's the recommended way to ensure the queue is not monopolized by one consumer's message types.

Configuring the bus with DI in that case might be tricky, as you have to explicitly specify the bindings between bus instances and the consumers each one serves.

It might be easier to split them into separate applications/services, but I know it can be a hassle to deploy and configure.

"queue for publishing" doesn't make sense though. Like Travis said, post the details to the group, you'll get a lot of help there.

OTHER TIPS

You should only need one IServiceBus for publishing and consuming within a single process. Is the IServiceBus a singleton in your container? I'd suggestion collecting some example code (like how you setup your IServiceBus) and provide that to the mailing list https://groups.google.com/forum/?fromgroups#!forum/masstransit-discuss. It's hard to provide a solution without a little more info.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top