{"id":307069,"date":"2021-09-27T10:21:52","date_gmt":"2021-09-27T10:21:52","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=307069"},"modified":"2026-01-05T09:52:33","modified_gmt":"2026-01-05T09:52:33","slug":"message-queue-in-magento2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/","title":{"rendered":"Message Queue in Magento2"},"content":{"rendered":"<div class=\"wk-index-wrap\">\n<h3 class=\"index-title\">1. Why Magento 2 Needed a Message Queue System<\/h3>\n<\/div>\n<h4>The Core Problem: Synchronous Processing at Scale<\/h4>\n<p data-start=\"595\" data-end=\"665\">In traditional Magento workflows, most operations are <strong data-start=\"649\" data-end=\"664\">synchronous<\/strong>. Synchronous means <em data-start=\"711\" data-end=\"780\">\u201cdo everything right now and make the user wait until it finishes.\u201d<\/em><\/p>\n<p data-start=\"595\" data-end=\"665\">A synchronous process executes all logic in the same request\u2013response lifecycle. The HTTP request is blocked until every dependent operation finishes execution.<\/p>\n<p data-start=\"595\" data-end=\"665\"><strong>Example:<\/strong><\/p>\n<p data-start=\"595\" data-end=\"665\">You order food at a restaurant, and the cashier refuses to give you a receipt until:<\/p>\n<ul>\n<li data-start=\"595\" data-end=\"665\">The food is cooked<\/li>\n<li data-start=\"595\" data-end=\"665\">The plates are washed<\/li>\n<li data-start=\"595\" data-end=\"665\">The ingredients are restocked<\/li>\n<li data-start=\"595\" data-end=\"665\">The chef submits a report<\/li>\n<\/ul>\n<p>That\u2019s inefficient and frustrating.<\/p>\n<p>Magento faced the same issue with:<\/p>\n<ul>\n<li>Order placement<\/li>\n<li>Inventory updates<\/li>\n<li>Email notifications<\/li>\n<li>Third-party integrations<\/li>\n<li>Indexing operations<\/li>\n<\/ul>\n<p>As Magento installations scaled (large catalogs, heavy traffic, multiple integrations), this approach became <strong data-start=\"1496\" data-end=\"1524\">slow, fragile, and risky<\/strong>.<\/p>\n<div class=\"wk-index-wrap\">\n<h3 class=\"index-title\">2. What Is a Message Queue?<\/h3>\n<\/div>\n<p>A message queue is a system that lets you <strong data-start=\"1675\" data-end=\"1712\">store a task and process it later<\/strong>, instead of immediately.<br \/>It is an <strong data-start=\"1790\" data-end=\"1830\">asynchronous communication mechanism<\/strong> where:<\/p>\n<ul>\n<li>A <strong data-start=\"1842\" data-end=\"1854\">producer<\/strong> publishes a message<\/li>\n<li>The message is stored in a <strong data-start=\"1904\" data-end=\"1913\">queue<\/strong><\/li>\n<li>A <strong data-start=\"1918\" data-end=\"1930\">consumer<\/strong> processes the message independently of the original request<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<ul>\n<li>You write a letter (message)<\/li>\n<li>Drop it in a mailbox (queue)<\/li>\n<li>The post office delivers it later (consumer)<\/li>\n<li>You don\u2019t wait at the mailbox until delivery is complete<\/li>\n<\/ul>\n<p>Magento adopted this model to <strong data-start=\"2220\" data-end=\"2275\">decouple heavy operations from user-facing requests<\/strong>.<\/p>\n<div class=\"wk-index-wrap\">\n<h3 class=\"index-title\">3. Asynchronous vs Synchronous Execution in Magento<\/h3>\n<\/div>\n<h4>1. Synchronous Flow (Traditional)<\/h4>\n<p><strong>Execution flow:<\/strong><\/p>\n<ol>\n<li>Customer places an order<\/li>\n<li>Magento:<br \/>&#8211; Saves order<br \/>&#8211; Sends emails<br \/>&#8211; Updates inventory<br \/>&#8211; Triggers ERP sync<br \/>&#8211; Updates analytics<\/li>\n<li>Response is returned<\/li>\n<\/ol>\n<p><strong>Problems:<\/strong><\/p>\n<ul>\n<li>Slow checkout<\/li>\n<li>Higher timeout risk<\/li>\n<li>Any failure breaks the entire flow<\/li>\n<\/ul>\n<h4>2. Asynchronous Flow (With Message Queue)<\/h4>\n<p><strong>Execution flow:<\/strong><\/p>\n<ol>\n<li>Customer places an order<\/li>\n<li>Magento:<br \/>&#8211; Saves order<br \/>&#8211; Publishes messages for additional tasks<\/li>\n<li>Response is returned immediately<\/li>\n<li>Background consumers process tasks independently<\/li>\n<\/ol>\n<p><strong>Why this matters:<\/strong><\/p>\n<ul>\n<li>Faster response times<\/li>\n<li>Fault isolation<\/li>\n<li>Better scalability<\/li>\n<\/ul>\n<div class=\"wk-index-wrap\">\n<h3 class=\"index-title\">4. Core Components of Magento 2 Message Queue System<\/h3>\n<\/div>\n<p>Magento\u2019s message queue architecture is composed of <strong data-start=\"3280\" data-end=\"3302\">well-defined roles<\/strong>.<\/p>\n<h4>Publisher \u2014 The Message Producer<\/h4>\n<h5>1. What Is a Publisher?<\/h5>\n<p>A publisher is the part of the system that <strong data-start=\"3449\" data-end=\"3496\">creates a message and sends it to the queue<\/strong>. It\u00a0uses Magento\u2019s <code data-start=\"3555\" data-end=\"3575\">PublisherInterface<\/code> to send serialized data to a specific <strong data-start=\"3614\" data-end=\"3623\">topic<\/strong>.<\/p>\n<h5>2. Publisher Responsibilities<\/h5>\n<ul>\n<li>Prepare message payload<\/li>\n<li>Serialize data (JSON)<\/li>\n<li>Publish to a topic<\/li>\n<li>Remain unaware of who processes it<\/li>\n<\/ul>\n<p>Publishers do <strong data-start=\"3933\" data-end=\"3940\">not<\/strong> know about consumers. This ensures <strong data-start=\"3977\" data-end=\"3995\">loose coupling<\/strong>.<\/p>\n<h4>Topics \u2014 The Communication Contract<\/h4>\n<h5>1. What Is a Topic?<\/h5>\n<p>A topic is a <strong data-start=\"4111\" data-end=\"4128\">named channel<\/strong> that describes <em data-start=\"4144\" data-end=\"4174\">what kind of message this is<\/em>.<br \/>It defines:<\/p>\n<ul>\n<li>Message name<\/li>\n<li>Expected payload schema<\/li>\n<li>Communication contract between publisher and consumers<\/li>\n<\/ul>\n<p>Topics are declared in:<br \/><code data-start=\"3555\" data-end=\"3575\">etc\/communication.xml<\/code><\/p>\n<h5>2. Why Topics Matter<\/h5>\n<p>Topics:<\/p>\n<ul>\n<li>Enforce data consistency<\/li>\n<li>Allow multiple consumers<\/li>\n<li>Act as stable integration points<\/li>\n<\/ul>\n<h4>Message Payload \u2014 What Data Is Sent<\/h4>\n<p>The payload is the <strong data-start=\"4738\" data-end=\"4753\">actual data<\/strong> inside the message. Magento serializes the payload (usually JSON) before sending it to the queue.<\/p>\n<h4>Queues \u2014 The Holding Area<\/h4>\n<h5>1. What Is a Queue?<\/h5>\n<p>A queue is a <strong data-start=\"5147\" data-end=\"5173\">waiting line for tasks<\/strong>. Queues store messages until a consumer retrieves and processes them.<\/p>\n<h5>2. Queue Behavior<\/h5>\n<ul>\n<li>FIFO (First In, First Out)<\/li>\n<li>Durable (messages survive restarts)<\/li>\n<li>Can retry failed messages<\/li>\n<\/ul>\n<h4>Consumers \u2014 The Workers<\/h4>\n<h5>1. What Is a Consumer?<\/h5>\n<p>A consumer is a <strong data-start=\"5655\" data-end=\"5676\">background worker<\/strong> that processes messages from a queue.<\/p>\n<p>A consumer:<\/p>\n<ul>\n<li>Listens to a queue<\/li>\n<li>Deserializes the message<\/li>\n<li>Executes business logic<\/li>\n<li>Acknowledges success or failure<\/li>\n<\/ul>\n<p>Defined in:<\/p>\n<p><code data-start=\"3555\" data-end=\"3575\">etc\/queue_consumer.xml<\/code><\/p>\n<p>Consumers are executed via CLI:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">bin\/magento queue:consumers:start consumer_name<\/pre>\n<h4>Message Broker \u2014 RabbitMQ vs MySQL<\/h4>\n<h5>1. What Is a Message Broker?<\/h5>\n<p>A broker is the system that <strong data-start=\"6379\" data-end=\"6422\">physically stores and delivers messages<\/strong>.<\/p>\n<p>Magento supports:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.rabbitmq.com\/\">RabbitMQ<\/a> (recommended)<\/li>\n<li>MySQL (fallback)<\/li>\n<\/ul>\n<h5>2. RabbitMQ (Recommended)<\/h5>\n<p><strong>Why Magento prefers RabbitMQ:<\/strong><\/p>\n<ul>\n<li>High throughput<\/li>\n<li>Reliable message delivery<\/li>\n<li>Advanced routing<\/li>\n<li>Acknowledgement handling<\/li>\n<\/ul>\n<h5>3. MySQL Message Queue<\/h5>\n<p><strong>When it\u2019s used:<\/strong><\/p>\n<ul>\n<li>RabbitMQ not installed<\/li>\n<li>Small or development environments<\/li>\n<\/ul>\n<p><strong>Limitations:<\/strong><\/p>\n<ul>\n<li>Database load<\/li>\n<li>Lower performance<\/li>\n<li>Not ideal for scale<\/li>\n<\/ul>\n<p><code data-start=\"3555\" data-end=\"3575\"><\/code><\/p>\n<div class=\"wk-index-wrap\">\n<h3 class=\"index-title\">5. Message Queue Implementation Steps<\/h3>\n<\/div>\n<h4>1. Create a Custom Module<\/h4>\n<p><strong>Path: <\/strong><em>app\/code\/YourVendor\/QueueExample<\/em><\/p>\n<p><strong>registration.php<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?php\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n    \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n    'YourVendor_QueueExample',\n    __DIR__\n);<\/pre>\n<p><strong>etc\/module.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\"?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module\/etc\/module.xsd\"&gt;\n    &lt;module name=\"YourVendor_QueueExample\"\/&gt;\n&lt;\/config&gt;<\/pre>\n<h4>2. Define the Message Queue Topics<\/h4>\n<p><strong>etc\/communication.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\"?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Communication\/etc\/communication.xsd\"&gt;\n\n    &lt;topic name=\"notifycustomer.massmail\" request=\"string\"&gt;\n        &lt;handler name=\"notifycustomer.massmail\"\n                 type=\"YourVendor\\QueueExample\\Model\\Consumer\"\n                 method=\"process\"\/&gt;\n    &lt;\/topic&gt;\n\n&lt;\/config&gt;<\/pre>\n<h4>3. Map Queue to Consumer<\/h4>\n<p><strong>etc\/queue_consumer.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\"?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework-message-queue:etc\/consumer.xsd\"&gt;\n    &lt;consumer name=\"notifycustomer.massmail\"\n              queue=\"notifycustomer.massmail\"\n              connection=\"db\"\n              consumerInstance=\"Magento\\Framework\\MessageQueue\\Consumer\"\n              handler=\"Webkul\\MessageQueue\\Model\\Consumer::process\"\/&gt;\n\n&lt;\/config&gt;<\/pre>\n<h4>4. Define Publisher Settings<\/h4>\n<p><strong>etc\/queue_publisher.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\"?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"urn:magento:framework-message-queue:etc\/publisher.xsd\"&gt;\n\n    &lt;publisher topic=\"notifycustomer.massmail\"&gt;\n        &lt;connection name=\"db\" exchange=\"magento-db\"\/&gt;\n    &lt;\/publisher&gt;\n\n&lt;\/config&gt;<\/pre>\n<h4>5. Define Queue Topology<\/h4>\n<p><strong>etc\/queue_topology.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\"?&gt;\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n    xsi:noNamespaceSchemaLocation=\"urn:magento:framework-message-queue:etc\/topology.xsd\"&gt;\n\n    &lt;exchange name=\"magento-db\" type=\"topic\" connection=\"db\"&gt;\n        &lt;binding id=\"binding_notifycustomer\"\n                 topic=\"notifycustomer.massmail\"\n                 destinationType=\"queue\"\n                 destination=\"notifycustomer.massmail\"\/&gt;\n    &lt;\/exchange&gt;\n\n&lt;\/config&gt;<\/pre>\n<h4>6. Write the Consumer Class<\/h4>\n<p><strong>Model\/Consumer.php<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?php\nnamespace YourVendor\\QueueExample\\Model;\n\nclass Consumer\n{\n    \/**\n     * The process() method is called by the message queue when a message arrives\n     * @param string $message\n     *\/\n    public function process($message)\n    {\n        \/\/ Decode JSON and process\n        $data = json_decode($message, true);\n\n        \/\/ Example logic: perform notification or update database\n        \/\/ replace with your own business logic\n        foreach ($data as $item) {\n            \/\/ your processing code here\n        }\n    }\n}<\/pre>\n<h4>7. Write the Publisher Logic<\/h4>\n<p>This is the code that will <strong data-start=\"4694\" data-end=\"4724\">send messages to the queue<\/strong> during normal Magento operations.<\/p>\n<p><strong>Example Observer<\/strong><\/p>\n<p>Use an observer to publish messages when something happens (e.g., after product save).<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">namespace YourVendor\\QueueExample\\Observer;\n\nuse Magento\\Framework\\Event\\ObserverInterface;\nuse Magento\\Framework\\MessageQueue\\PublisherInterface;\nuse Magento\\Framework\\Json\\Helper\\Data as JsonHelper;\n\nclass AfterProductSave implements ObserverInterface\n{\n    private $publisher;\n    private $jsonHelper;\n\n    public function __construct(\n        PublisherInterface $publisher,\n        JsonHelper $jsonHelper\n    ) {\n        $this-&gt;publisher = $publisher;\n        $this-&gt;jsonHelper = $jsonHelper;\n    }\n\n    public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n    {\n        $product = $observer-&gt;getProduct();\n        $data = [\n            'id' =&gt; $product-&gt;getId(),\n            'sku' =&gt; $product-&gt;getSku()\n        ];\n\n        $this-&gt;publisher-&gt;publish(\n            'notifycustomer.massmail',\n            $this-&gt;jsonHelper-&gt;jsonEncode($data)\n        );\n    }\n}\n<\/pre>\n<p>Here, when a product is saved, <strong data-start=\"5829\" data-end=\"5863\">a message is sent to the queue<\/strong> containing product details.<\/p>\n<div class=\"wk-index-wrap\">\n<h3 class=\"index-title\">6. Conclusion<\/h3>\n<\/div>\n<p>Magento 2\u2019s message queue system is <strong data-start=\"8535\" data-end=\"8562\">not an optional feature<\/strong>\u2014it is a <strong data-start=\"8571\" data-end=\"8611\">foundational architectural component<\/strong> designed for scale, reliability, and performance.<\/p>\n<p>Understanding it deeply allows developers to:<\/p>\n<ul>\n<li>Design better modules<\/li>\n<li>Avoid performance bottlenecks<\/li>\n<li>Build enterprise-grade Magento solutions<\/li>\n<\/ul>\n<p>Know more about\u00a0<a class=\"wk-external-link\" href=\"https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/message-queues\/\" target=\"_blank\" rel=\"nofollow external noopener noreferrer\" data-wpel-link=\"external\">Magento 2 Message Queue<\/a>.<\/p>\n\n\n<p>Looking to improve your store\u2019s speed and overall performance? Check out our&nbsp;<a href=\"https:\/\/webkul.com\/magento-speed-optimization-services\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Speed &amp; Optimization services<\/a>.<\/p>\n\n\n\n<p>For expert guidance or custom feature development, you may&nbsp;<strong><a href=\"https:\/\/webkul.com\/hire-magento-developers\/\" target=\"_blank\" rel=\"noreferrer noopener\">hire our Magento 2 developers<\/a><\/strong>&nbsp;to support your project.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Why Magento 2 Needed a Message Queue System The Core Problem: Synchronous Processing at Scale In traditional Magento workflows, most operations are synchronous. Synchronous means \u201cdo everything right now and make the user wait until it finishes.\u201d A synchronous process executes all logic in the same request\u2013response lifecycle. The HTTP request is blocked until <a href=\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":371,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[9444,7040],"class_list":["post-307069","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-message","tag-queue-management"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Message Queue in Magento2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Learn how message queue work in Magento 2, including publishers, topics, queues, consumers with clear examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Message Queue in Magento2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how message queue work in Magento 2, including publishers, topics, queues, consumers with clear examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-27T10:21:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-05T09:52:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sapna Bhatt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sapna Bhatt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\"},\"author\":{\"name\":\"Sapna Bhatt\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/19bd47bcd34512fea82988056ad09354\"},\"headline\":\"Message Queue in Magento2\",\"datePublished\":\"2021-09-27T10:21:52+00:00\",\"dateModified\":\"2026-01-05T09:52:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\"},\"wordCount\":812,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"message\",\"Queue Management\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\",\"url\":\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\",\"name\":\"Message Queue in Magento2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2021-09-27T10:21:52+00:00\",\"dateModified\":\"2026-01-05T09:52:33+00:00\",\"description\":\"Learn how message queue work in Magento 2, including publishers, topics, queues, consumers with clear examples.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Message Queue in Magento2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/19bd47bcd34512fea82988056ad09354\",\"name\":\"Sapna Bhatt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c5372a39f939b0b04e8e1b6cd39896508836fddac4a0fab696de8ad408380d26?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c5372a39f939b0b04e8e1b6cd39896508836fddac4a0fab696de8ad408380d26?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Sapna Bhatt\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/sapna-bhatt289\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Message Queue in Magento2 - Webkul Blog","description":"Learn how message queue work in Magento 2, including publishers, topics, queues, consumers with clear examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/","og_locale":"en_US","og_type":"article","og_title":"Message Queue in Magento2 - Webkul Blog","og_description":"Learn how message queue work in Magento 2, including publishers, topics, queues, consumers with clear examples.","og_url":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-09-27T10:21:52+00:00","article_modified_time":"2026-01-05T09:52:33+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Sapna Bhatt","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Sapna Bhatt","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/"},"author":{"name":"Sapna Bhatt","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/19bd47bcd34512fea82988056ad09354"},"headline":"Message Queue in Magento2","datePublished":"2021-09-27T10:21:52+00:00","dateModified":"2026-01-05T09:52:33+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/"},"wordCount":812,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["message","Queue Management"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/","url":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/","name":"Message Queue in Magento2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2021-09-27T10:21:52+00:00","dateModified":"2026-01-05T09:52:33+00:00","description":"Learn how message queue work in Magento 2, including publishers, topics, queues, consumers with clear examples.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/message-queue-in-magento2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/message-queue-in-magento2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Message Queue in Magento2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/19bd47bcd34512fea82988056ad09354","name":"Sapna Bhatt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c5372a39f939b0b04e8e1b6cd39896508836fddac4a0fab696de8ad408380d26?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c5372a39f939b0b04e8e1b6cd39896508836fddac4a0fab696de8ad408380d26?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Sapna Bhatt"},"url":"https:\/\/webkul.com\/blog\/author\/sapna-bhatt289\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/307069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/371"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=307069"}],"version-history":[{"count":48,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/307069\/revisions"}],"predecessor-version":[{"id":520572,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/307069\/revisions\/520572"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=307069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=307069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=307069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}