{"id":134691,"date":"2018-07-23T09:53:04","date_gmt":"2018-07-23T09:53:04","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=134691"},"modified":"2024-07-19T08:09:22","modified_gmt":"2024-07-19T08:09:22","slug":"here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/","title":{"rendered":"How to configure and use RabbitMQ in Magento 2"},"content":{"rendered":"\n<p>RabbitMQ is an important part of the <a href=\"https:\/\/webkul.com\/blog\/magento-2-architecture\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 architecture<\/a>, and it provides a scalable and reliable messaging system that enables the system to handle complex tasks and high volumes of traffic.<\/p>\n\n\n\n<p>Also, look no further and grab the opportunity to start your projects with the certified <a href=\"https:\/\/webkul.com\/magento-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 development company<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1# For configure RabbitMQ in Magento  to you need to add RabbitMQ details in Magento env.php file<\/h4>\n\n\n\n<p>env.php file location in magento :&nbsp; magento-root-dir\/app\/etc\/env.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">    &#039;queue&#039; =&gt;  &#091;\n        &#039;amqp&#039; =&gt;  &#091;\n            &#039;host&#039; =&gt; &#039;34.222.345.76&#039;, \/\/host of RabbitMQ\n            &#039;port&#039; =&gt; &#039;5672&#039;, \/\/Port on which RabbitMQ running. 5672 is default port\n            &#039;user&#039; =&gt; &#039;admin&#039;, \/\/ RabbitMQ user name\n            &#039;password&#039; =&gt; &#039;xxxxxxxxxxxxx&#039;, \/\/RabbitMQ password\n            &#039;virtualhost&#039; =&gt; &#039;\/&#039;, \/\/The virtual host for connecting to RabbitMQ. The default is \/.\n            &#039;ssl&#039; =&gt; &#039;&#039;,\n        ],\n    ],<\/pre>\n\n\n\n<p>Now after configuration we will use RabbitMQ in our Custom Module<\/p>\n\n\n\n<p>For this we need to create following four files in our module etc folder<\/p>\n\n\n\n<p><strong>location of etc folder in your modul<\/strong>e : magento-root\/app\/code\/NameSpace\/ModuleName\/etc<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2# 1st we will create&nbsp;communication.xml in&nbsp;magento-root\/app\/code\/NameSpace\/ModuleName\/etc folder<\/h4>\n\n\n\n<p>This file Contains a list of topics. Which are Intended to contain message queue information shared between implementations.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework-message-queue:etc\/queue.xsd&quot;&gt;\n    &lt;!-- you can name topic according to self --&gt;\n    &lt;topic name=&quot;yourtopibname.topic&quot; request=&quot;string&quot; \/&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3# create queue_topology.xml in&nbsp;magento-root\/app\/code\/NameSpace\/ModuleName\/etc folder<\/h4>\n\n\n\n<p>This file define the message routing rules and declares queues and exchanges.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework-message-queue:etc\/queue_topology.xsd&quot;&gt;\n    &lt;!-- name : A unique ID for the exchange  --&gt;\n    &lt;!-- type : Specifies the type of exchange. Must be topic --&gt;\n    &lt;!-- connection: For AMQP connections, a string that identifies the connection. For MySQL connections, the connection name must be db --&gt;\n    &lt;exchange name=&quot;magento&quot; type=&quot;topic&quot; connection=&quot;amqp&quot;&gt;\n        &lt;!-- id: A unique ID for this binding --&gt;\n        &lt;!-- topic: The name of a topic --&gt;\n        &lt;!-- destinationType: Must be queue --&gt;\n        &lt;!-- destination: Identifies the name of a queue --&gt;\n        &lt;binding id=&quot;uniqueIdBinding&quot; topic=&quot;yourtopibname.topic&quot; destinationType=&quot;queue&quot; destination=&quot;yourQueue&quot;\/&gt;\n    &lt;\/exchange&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4# create queue_consumer.xml in&nbsp;magento-root\/app\/code\/NameSpace\/ModuleName\/etc folder<\/h4>\n\n\n\n<p>This file define the relationship between an existing queue and its consumer.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework-message-queue:etc\/queue_consumer.xsd&quot;&gt;\n    &lt;!-- name: The name of the consumer --&gt;\n    &lt;!-- queue: Defines the queue name to send the message to --&gt;\n    &lt;!-- connection: For AMQP connections, the connection name must match the connection attribute in the queue_topology.xml file. Otherwise, the connection name must be db --&gt;\n    &lt;!-- consumerInstance: The Magento class name that consumes the message --&gt;\n    &lt;consumer name=&quot;consumerName&quot; queue=&quot;yourQueue&quot; connection=&quot;amqp&quot; consumerInstance=&quot;NameSpace\\ModuleName\\Model\\MassConsumer&quot;\/&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 5# create queue_publisher.xml in&nbsp;magento-root\/app\/code\/NameSpace\/ModuleName\/etc folder<\/h4>\n\n\n\n<p>This file defines which connection and exchange to use to publish messages for a specific topic.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework-message-queue:etc\/queue_publisher.xsd&quot;&gt;\n    &lt;!-- topic: Name of topic--&gt;\n    &lt;publisher topic=&quot;yourtopibname.topic&quot;&gt;\n        &lt;!-- name: For AMQP connections, the connection name must match the connection attribute in the queue_topology.xml file. Otherwise, the connection name must be db --&gt;\n        &lt;!-- exchange: The name of the exchange to publish to. The default system exchange name is magento --&gt;\n        &lt;connection name=&quot;amqp&quot; exchange=&quot;magento&quot; \/&gt; &lt;!-- Advanced Message Queuing Protocol  --&gt;\n    &lt;\/publisher&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Now i will login in RabbitMQ panel and check queue list<\/h4>\n\n\n\n<p>You can also further learn more about <a href=\"https:\/\/experienceleague.adobe.com\/docs\/commerce-operations\/installation-guide\/prerequisites\/rabbitmq.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">what is\u00a0 RabbitMQ<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><img decoding=\"async\" width=\"1221\" height=\"628\" class=\"alignnone wp-image-134717 size-full\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png\" alt=\"RabbitMq -1\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png 1221w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026-250x129.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026-300x154.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026-768x395.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026-1200x617.png 1200w\" sizes=\"(max-width: 1221px) 100vw, 1221px\" loading=\"lazy\" \/><\/h4>\n\n\n\n<p>There are no Queues in panel now i will install our module in magento<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento setup:upgrade<\/pre>\n\n\n\n<p>After installation we got our queue in RabbitMQ panel as follow<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1180\" height=\"436\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_027.png\" alt=\"RabbitMq -2\" class=\"wp-image-134721\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_027.png 1180w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_027-250x92.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_027-300x111.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_027-768x284.png 768w\" sizes=\"(max-width: 1180px) 100vw, 1180px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Our queue &#8220;yourQueue&#8221; added in RabbitMQ now we will write code for publish message in this our queue<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 6# Here&nbsp; i will create a controller from which i will add message in our Queue<\/h4>\n\n\n\n<p>create file : NameSpace\\ModuleName\\Controller\\Adminhtml\\PublishMessage\\InRabbitMQ.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace NameSpace\\ModuleName\\Controller\\Adminhtml\\PublishMessage;\n\nuse Magento\\Backend\\App\\Action\\Context;\nuse Magento\\Framework\\Controller\\Result\\JsonFactory;\nuse Magento\\Framework\\Json\\Helper\\Data as JsonHelper;\nuse NameSpace\\ModuleName\\Logger\\Logger;\n\nclass InRabbitMQ extends \\Magento\\Backend\\App\\Action\n{\n    \/**\n     * @var \\Magento\\Framework\\Controller\\Result\\JsonFactory\n     *\/\n    private $resultJsonFactory;\n\n    \/**\n     * @var \\Magento\\Framework\\Json\\Helper\\Data\n     *\/\n    private $jsonHelper;\n\n    \/**\n     * @var \\Magento\\Framework\\MessageQueue\\PublisherInterface\n     *\/\n    private $publisher;\n\n    \/**\n     * @var \\NameSpace\\ModuleName\\Logger\\Logger\n     *\/\n    private $logger;\n\n    \/**\n     * @param Context $context\n     * @param JsonFactory $resultJsonFactory\n     * @param JsonHelper $jsonHelper\n     * @param \\Magento\\Framework\\MessageQueue\\PublisherInterface $publisher\n     * @param Logger $logger\n     *\/\n    public function __construct(\n        Context $context,\n        JsonFactory $resultJsonFactory,\n        JsonHelper $jsonHelper,\n        \\Magento\\Framework\\MessageQueue\\PublisherInterface $publisher, \/\/ use for publish message in RabbitMQ\n        Logger $logger\n    ) {\n        parent::__construct($context);\n        $this-&gt;resultJsonFactory = $resultJsonFactory;\n        $this-&gt;jsonHelper = $jsonHelper;\n        $this-&gt;publisher = $publisher;\n        $this-&gt;logger = $logger;\n    }\n\n    \/**\n     * @return \\Magento\\Backend\\Model\\View\\Result\\Page\n     *\/\n    public function execute()\n    {\n        try {\n            $resultJson = $this-&gt;resultJsonFactory-&gt;create();\n\n            \/**\n             * Here we are using random product id and product data as $item for message publish\n             * @var int $productId \n             * @var array $item\n             *\/\n            $publishData = &#091;&#039;mage_pro_id&#039; =&gt; $productId, &#039;item&#039; =&gt; $item];\n            \/\/ yourtopibname.topic same as you add in communication.xml file\n            $this-&gt;publisher-&gt;publish(&#039;yourtopibname.topic&#039;, $this-&gt;jsonHelper-&gt;jsonEncode($publishData));\n            $result = &#091;&#039;msg&#039; =&gt; &#039;success&#039;];\n            return $resultJson-&gt;setData($result);\n        } catch (\\Exception $e) {\n            $result = &#091;&#039;error&#039; =&gt; $e-&gt;getMessage()];\n            return $resultJson-&gt;setData($result);\n        }\n        \n    }\n\n    \/**\n     * Check product import permission.\n     *\n     * @return bool\n     *\/\n    protected function _isAllowed()\n    {\n        return $this-&gt;_authorization-&gt;isAllowed(&#039;NameSpace_ModuleName::product_import&#039;);\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 7# we will create Model class for process queue message(data) and return result to consumer.<\/h4>\n\n\n\n<p>create file : NameSpace\\ModuleName\\Model\\ProcessQueueMsg.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * @category   NameSpace\n * @package    NameSpace_ModuleName\n * @author     Webkul Software Private Limited\n * @copyright  Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license    https:\/\/store.webkul.com\/license.html\n *\/\nnamespace NameSpace\\ModuleName\\Model;\n\n\/**\n * ProcessQueueMsg Model\n *\/\nclass ProcessQueueMsg\n{\n    \/**\n     * process\n     * @param $message\n     * @return\n     *\/\n    public function process($message)\n    {\n        \/\/ Here you can process your data and and return result\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 8# Now we will create consumer class for process queue message<\/h4>\n\n\n\n<p>create file: NameSpace\\ModuleName\\Model\\MassConsumer.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\nnamespace NameSpace\\ModuleName\\Model;\n\nuse Magento\\Framework\\App\\ResourceConnection;\nuse NameSpace\\ModuleName\\Logger\\Logger;\nuse Magento\\Framework\\MessageQueue\\MessageLockException;\nuse Magento\\Framework\\MessageQueue\\ConnectionLostException;\nuse Magento\\Framework\\Exception\\NotFoundException;\nuse Magento\\Framework\\MessageQueue\\CallbackInvoker;\nuse Magento\\Framework\\MessageQueue\\ConsumerConfigurationInterface;\nuse Magento\\Framework\\MessageQueue\\EnvelopeInterface;\nuse Magento\\Framework\\MessageQueue\\QueueInterface;\nuse Magento\\Framework\\MessageQueue\\LockInterface;\nuse Magento\\Framework\\MessageQueue\\MessageController;\nuse Magento\\Framework\\MessageQueue\\ConsumerInterface;\n\n\/**\n * Class Consumer used to process OperationInterface messages.\n *\n * @SuppressWarnings(PHPMD.CouplingBetweenObjects)\n *\/\nclass MassConsumer implements ConsumerInterface\n{\n    \/**\n     * @var \\Magento\\Framework\\MessageQueue\\CallbackInvoker\n     *\/\n    private $invoker;\n\n    \/**\n     * @var \\Magento\\Framework\\App\\ResourceConnection\n     *\/\n    private $resource;\n\n    \/**\n     * @var \\Magento\\Framework\\MessageQueue\\ConsumerConfigurationInterface\n     *\/\n    private $configuration;\n\n    \/**\n     * @var \\Magento\\Framework\\MessageQueue\\MessageController\n     *\/\n    private $messageController;\n\n    \/**\n     * @var LoggerInterface\n     *\/\n    private $logger;\n\n    \/**\n     * @var OperationProcessor\n     *\/\n    private $operationProcessor;\n\n    \/**\n     * Initialize dependencies.\n     *\n     * @param CallbackInvoker $invoker\n     * @param ResourceConnection $resource\n     * @param MessageController $messageController\n     * @param ConsumerConfigurationInterface $configuration\n     * @param OperationProcessorFactory $operationProcessorFactory\n     * @param LoggerInterface $logger\n     *\/\n    public function __construct(\n        CallbackInvoker $invoker,\n        ResourceConnection $resource,\n        MessageController $messageController,\n        ConsumerConfigurationInterface $configuration,\n        \\NameSpace\\ModuleName\\Model\\ProcessQueueMsg $processQueueMsg,\n        Logger $logger\n    ) {\n        $this-&gt;invoker = $invoker;\n        $this-&gt;resource = $resource;\n        $this-&gt;messageController = $messageController;\n        $this-&gt;configuration = $configuration;\n        $this-&gt;processQueueMsg = $processQueueMsg;\n        $this-&gt;logger = $logger;\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    public function process($maxNumberOfMessages = null)\n    {\n        $queue = $this-&gt;configuration-&gt;getQueue();\n        if (!isset($maxNumberOfMessages)) {\n            $queue-&gt;subscribe($this-&gt;getTransactionCallback($queue));\n        } else {\n            $this-&gt;invoker-&gt;invoke($queue, $maxNumberOfMessages, $this-&gt;getTransactionCallback($queue));\n        }\n    }\n\n    \/**\n     * Get transaction callback. This handles the case of async.\n     *\n     * @param QueueInterface $queue\n     * @return \\Closure\n     *\/\n    private function getTransactionCallback(QueueInterface $queue)\n    {\n        return function (EnvelopeInterface $message) use ($queue) {\n            \/** @var LockInterface $lock *\/\n            $lock = null;\n            try {\n                $lock = $this-&gt;messageController-&gt;lock($message, $this-&gt;configuration-&gt;getConsumerName());\n                $message = $message-&gt;getBody();\n                \/**\n                 * $this-&gt;processQueueMsg-&gt;process() use for process message which you publish in queue\n                 *\/\n                $data = $this-&gt;processQueueMsg-&gt;process($message);\n                if ($data === false) {\n                    $queue-&gt;reject($message); \/\/ if get error in message process\n                }\n                $queue-&gt;acknowledge($message); \/\/ send acknowledge to queue \n            } catch (MessageLockException $exception) {\n                $queue-&gt;acknowledge($message);\n            } catch (ConnectionLostException $e) {\n                $queue-&gt;acknowledge($message);\n                if ($lock) {\n                    $this-&gt;resource-&gt;getConnection()\n                        -&gt;delete($this-&gt;resource-&gt;getTableName(&#039;queue_lock&#039;), &#091;&#039;id = ?&#039; =&gt; $lock-&gt;getId()]);\n                }\n            } catch (NotFoundException $e) {\n                $queue-&gt;acknowledge($message);\n                $this-&gt;logger-&gt;warning($e-&gt;getMessage());\n            } catch (\\Exception $e) {\n                $queue-&gt;reject($message, false, $e-&gt;getMessage());\n                $queue-&gt;acknowledge($message);\n                if ($lock) {\n                    $this-&gt;resource-&gt;getConnection()\n                        -&gt;delete($this-&gt;resource-&gt;getTableName(&#039;queue_lock&#039;), &#091;&#039;id = ?&#039; =&gt; $lock-&gt;getId()]);\n                }\n            }\n        };\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 9# Now we will check our consumer from terminal<\/h4>\n\n\n\n<p>Run following command from magento root directory<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento queue:consumers:list<\/pre>\n\n\n\n<p>After run above command you will get following result on terminal<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"912\" height=\"122\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_028.png\" alt=\"RabbitMq -4\" class=\"wp-image-134814\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_028.png 912w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_028-250x33.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_028-300x40.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_028-768x103.png 768w\" sizes=\"(max-width: 912px) 100vw, 912px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 10# Now for run consumer we need to execute following command from terminal<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento queue:consumers:start consumerName<\/pre>\n\n\n\n<p>For&nbsp; run this process in backend you need to add &#8220;&amp;&#8221; in above command as following<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento queue:consumers:start consumerName &amp;<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1050\" height=\"209\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_029.png\" alt=\"RabbitMq -4\" class=\"wp-image-134825\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_029.png 1050w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_029-250x50.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_029-300x60.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_029-768x153.png 768w\" sizes=\"(max-width: 1050px) 100vw, 1050px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Thank you&nbsp; \ud83d\ude42<\/p>\n\n\n\n<p>Well, that was about RabbitMQ in Magento 2. <\/p>\n\n\n\n<p>You can also have a look at our <a href=\"https:\/\/store.webkul.com\/Magento-2.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 extensions<\/a> already crafted by certified Adobe Commerce Developers. <\/p>\n\n\n\n<p>For a personalized experience, <a href=\"https:\/\/webkul.com\/hire-magento-developers\/\" target=\"_blank\" rel=\"noreferrer noopener\">hire Magento developers&nbsp;<\/a>who can dedicatedly work on your customised e-commerce projects.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>RabbitMQ is an important part of the Magento 2 architecture, and it provides a scalable and reliable messaging system that enables the system to handle complex tasks and high volumes of traffic. Also, look no further and grab the opportunity to start your projects with the certified Magento 2 development company. Step 1# For configure <a href=\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,302],"tags":[2056,2070,4408],"class_list":["post-134691","post","type-post","status-publish","format-standard","hentry","category-magento","category-magento2","tag-magento","tag-magento2","tag-rabbitmq"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to configure and use RabbitMQ in Magento 2<\/title>\n<meta name=\"description\" content=\"How to configure and use RabbitMQ ( Message queue )in Magento 2- a beginner&#039;s guide to understanding AMQP and Rabbitmq in detail.\" \/>\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\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to configure and use RabbitMQ in Magento 2\" \/>\n<meta property=\"og:description\" content=\"How to configure and use RabbitMQ ( Message queue )in Magento 2- a beginner&#039;s guide to understanding AMQP and Rabbitmq in detail.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\" \/>\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=\"2018-07-23T09:53:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-19T08:09:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png\" \/>\n<meta name=\"author\" content=\"Abhishek Singh\" \/>\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=\"Abhishek Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\"},\"author\":{\"name\":\"Abhishek Singh\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/573e459f54796eb4195511990de4bfd0\"},\"headline\":\"How to configure and use RabbitMQ in Magento 2\",\"datePublished\":\"2018-07-23T09:53:04+00:00\",\"dateModified\":\"2024-07-19T08:09:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\"},\"wordCount\":474,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png\",\"keywords\":[\"magento\",\"Magento2\",\"rabbitmq\"],\"articleSection\":[\"magento\",\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\",\"url\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\",\"name\":\"How to configure and use RabbitMQ in Magento 2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png\",\"datePublished\":\"2018-07-23T09:53:04+00:00\",\"dateModified\":\"2024-07-19T08:09:22+00:00\",\"description\":\"How to configure and use RabbitMQ ( Message queue )in Magento 2- a beginner's guide to understanding AMQP and Rabbitmq in detail.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png\",\"width\":\"1221\",\"height\":\"628\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to configure and use RabbitMQ in Magento 2\"}]},{\"@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\/573e459f54796eb4195511990de4bfd0\",\"name\":\"Abhishek Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?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\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Abhishek Singh\"},\"description\":\"Adobe Commerce certified Magento developer with over 12 years of experience at Webkul. Passionate about scalable Magento 2-based webshops, AI, and multi-channel integrations, Abhishek consistently delivers innovative and efficient e-commerce solutions that propel businesses forward.\",\"sameAs\":[\"http:\/\/webkul.com\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/abhishek\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to configure and use RabbitMQ in Magento 2","description":"How to configure and use RabbitMQ ( Message queue )in Magento 2- a beginner's guide to understanding AMQP and Rabbitmq in detail.","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\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/","og_locale":"en_US","og_type":"article","og_title":"How to configure and use RabbitMQ in Magento 2","og_description":"How to configure and use RabbitMQ ( Message queue )in Magento 2- a beginner's guide to understanding AMQP and Rabbitmq in detail.","og_url":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-07-23T09:53:04+00:00","article_modified_time":"2024-07-19T08:09:22+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png","type":"","width":"","height":""}],"author":"Abhishek Singh","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Abhishek Singh","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/"},"author":{"name":"Abhishek Singh","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/573e459f54796eb4195511990de4bfd0"},"headline":"How to configure and use RabbitMQ in Magento 2","datePublished":"2018-07-23T09:53:04+00:00","dateModified":"2024-07-19T08:09:22+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/"},"wordCount":474,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png","keywords":["magento","Magento2","rabbitmq"],"articleSection":["magento","Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/","url":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/","name":"How to configure and use RabbitMQ in Magento 2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png","datePublished":"2018-07-23T09:53:04+00:00","dateModified":"2024-07-19T08:09:22+00:00","description":"How to configure and use RabbitMQ ( Message queue )in Magento 2- a beginner's guide to understanding AMQP and Rabbitmq in detail.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2018\/07\/Selection_026.png","width":"1221","height":"628"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/here-we-will-learn-how-to-configure-and-use-rabbitmq-in-magento-2-3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to configure and use RabbitMQ in Magento 2"}]},{"@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\/573e459f54796eb4195511990de4bfd0","name":"Abhishek Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?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\/d4ac7e0e671bf743359d7e3f140c262d1b16d71106f0a1aeaecca327a2805ae4?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Abhishek Singh"},"description":"Adobe Commerce certified Magento developer with over 12 years of experience at Webkul. Passionate about scalable Magento 2-based webshops, AI, and multi-channel integrations, Abhishek consistently delivers innovative and efficient e-commerce solutions that propel businesses forward.","sameAs":["http:\/\/webkul.com"],"url":"https:\/\/webkul.com\/blog\/author\/abhishek\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/134691","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=134691"}],"version-history":[{"count":32,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/134691\/revisions"}],"predecessor-version":[{"id":453599,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/134691\/revisions\/453599"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=134691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=134691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=134691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}