I've been looking at Mass Transit for a couple of months now, and I'm really intrigued by the possibilities. However, I don't seem to be able to get the concepts quite right. I've looked the code, and I've gone through the documentation, but I just don't feel that I"m understanding it.
The examples in general show;
Bus.Initialize( sbc =>
{
sbc.UseMsmq( );
sbc.VerifyMsmqConfiguration( );
sbc.UseMulticastSubscriptionClient( );
sbc.ReceiveFrom( "msmq://localhost/myqueue" );
} );
Now, I understand what this is doing, but I don't think my brain is taking the concept further than this. Here's what I do understand;
I just want to understand a little more about this. I don't think I"m getting it. Do I need a server configured, listening? Do I set it up in my software then just publish messages, they get picked up and processed from within?
First off, getting start with MassTransit...
The idea is that you have multiple systems communicating. Now that's just messaging and doesn't really require MassTransit. A
talks to B
. When we start talking about pub/sub it can become more interesting. A
publishes msg CreateOrder
which B
is listening for. When B
receives that CreateOrder
message it can take whatever steps is required to handle a new order. This leaves the services decoupled, the only interaction point is a pretty simple message, the CreateOrder
.
Now the joy of pub/sub is that A
and B
are going back and forth for a while, and we have C
that wants to listen into CreateOrder
messages so it can prepare stock for shipping before B
completes all its tasks. We can drop C
into the bus, it subscribes to the CreateOrder
message and neither A
nor B
need to change any code. This can be done while they are actively sending messages back and forth. You need to upgrade one of the members involved? Just stop that service, drop in the new one, and restart it, allowing it to pick it where it left off.
If you have more questions on this topic, I'd try hitting up the mailing list. I'd like to believe we are rather responsive when we can be. Additionally you can hit up a couple related questions and books ...
Enterprise Integration Patterns is a great book, even if was written more with Java in mind.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With