rmsundar/rabbit-mq-priority

Sample module for rabbitmq priority queue

dev-main 2021-07-25 09:08 UTC

This package is not auto-updated.

Last update: 2024-06-04 06:51:57 UTC


README

Sample module to demonstrate the rabbitMq priority queue and other queue arguments

Magento has resolved the bug of allowing arguments for rabbitmq queue and exchange while creating in 2.4.2.

sample code for passing arguments to queue
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd">
    <exchange name="magento" type="topic" connection="amqp">
        <binding id="sample.priority" topic="sample.priority.topic" destinationType="queue" destination="sample.priority">
            <arguments>
                <argument name="x-max-priority" xsi:type="number">10</argument>
            </arguments>
        </binding>
    </exchange>
</config>

Magento OOTB doesn't support passing extra arguments to the message properties.

This module has a custom publisher which will allow passing extra properties while publishing a message to an exchange

Refer below classes to publish a message with properties