1

So, I read that Magento 2.3 will be introducing Messages Queues to Open Source. A feature currently available in the Commerce Edition.

I've found some information about it here and here. But I'm struggling to wrap my head around the terminology.

enter image description here

Please, could someone provide me with some real-case examples of how this is used. And also why it's such a good thing to have included in the Open Source Edition.

Thanks

1

One common use we have for Magento message queues is related to ERP integrations. For example: When a user places an order we want to transmit that data to a remote system. This transmission process over the network takes time that we don't want the user waiting.

Using a message queue allows us to decouple the ERP integration process from the customer order process. When Magento fires the sales_order_place_after event we just pass the order id (message) into the order export message queue (publisher) and let the order complete normally.

Now the message broker (RabbitMQ) will queue the order ids (messages) waiting for export until another process (consumer) to take an order id (message) and export that order. With the consumer being a background process there is more flexibility in running time and error handling.

It really took me playing with RabbitMQ to connect all the dots but hopefully, this is helpful.

  • You also lose control offered by a synchronous execution as a drawback – vitoriodachef Aug 9 '18 at 9:38
  • Thanks Ian. That kinda backs up what I suspected. Any idea what happens in a situation where the "message" is queued but later results in a failure when processed. Meanwhile the customer has moved on? Can that even occur? – Craig Aug 9 '18 at 9:40
  • @Craig When the broker accepts a message, it's now wholly sperate from the publisher. In the above example, once the order (message) is queued the user continues to the order confirmation page. Whatever happens to the message it's no longer connected to user interaction. It is entirely possible for the consumer to encounter an error, for example, the system the order is attempting to export to is down. The consumer is responsible for error handling and acknowledging to the broker a message can be removed from the queue, so messages don't get lost. – Ian at Xantek Aug 9 '18 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.