Service bus - am I dumb?

I've been looking at Mass Transit for a couple of months now, and I'm really intrigued by the possibilities. However, I do not seem to be able to correctly understand the concepts. I looked at the code and I looked at the documentation, but I just don't feel like I understand it.

Examples generally show;

Bus.Initialize( sbc => { sbc.UseMsmq( ); sbc.VerifyMsmqConfiguration( ); sbc.UseMulticastSubscriptionClient( ); sbc.ReceiveFrom( "msmq://localhost/myqueue" ); } ); 

Now I understand what it does, but I don’t think that my brain takes the concept beyond this. Here is what I understand:

  • Messages can be published from the software and subscribed to the service bus for actions / s, which will be performed upon receipt of this message.
  • The service bus itself is on top of the message queue (either RabbitMQ or MSMQ in MT)

I just want to understand a little more about this. I don't think I get it. Do I need a server configured, listening? I set it up in my software and then just posted the messages, they are collected and processed from the inside?

+6
source share
1 answer

First of all, start with MassTransit ...

The idea is that you have several systems communicating with each other. Now it's just messaging and doesn’t really need MassTransit. A talking to B When we start talking about pub / sub, it can become more interesting. A publishes msg CreateOrder , which listens to B When B receives a CreateOrder message, he can take any steps necessary to process the new order. This CreateOrder services, the only interaction point is a fairly simple message, CreateOrder .

Now the joy of pub / sub is that A and B go back and forth for a while, and we have C who wants to listen to CreateOrder messages CreateOrder that he can prepare the stock for delivery until B performs all his tasks. We can drop C into the bus, it subscribes to the CreateOrder message, and neither A nor B needs to change any code. This can be done when they actively send messages back and forth. Do you need to update one of the participants? Just stop this service, lower the new one and restart it, letting it choose where it left off.

If you have additional questions about this topic, I will try to click on the mailing list. I would like to believe that we are quite responsive when we can. In addition, you can find a couple of related questions and books ...

Enterprise integration templates are a great book, even if it was written more with Java in mind.

+4
source

Source: https://habr.com/ru/post/895915/


All Articles