rmsundar / rabbit-mq-priority
Sample module for rabbitmq priority queue
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- magento/framework: 103.0.*
- magento/framework-message-queue: ~100.4.2
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
- https://github.com/rmsundar1/magento-rabbitmq-priority-queue/blob/main/Model/PriorityConsumer.php
-
magento-rabbitmq-priority-queue/Console/Command/PriorityMessage.php
Line 53 in 9e37bb8
protected function execute(InputInterface $input, OutputInterface $output): void