Edit in GitHubLog an issue
Thanks to comwrap GmbH for contributing this topic!

Asynchronous configuration

When using the message queue, four configuration files are required in your component:

  • communication.xml
  • queue_consumer.xml
  • queue_topology.xml
  • queue_publisher.xml

For more information, see Configure message queues.

Asynchronous and Bulk APIs are built on top of the REST API and use the Message Queue Framework for processing messages. To simplify development, the Asynchronous API auto-generates communication.xml and queue_publisher.xml. The Magento/WebapiAsync module provides queue_topology.xml and queue_consumer.xml.

communication.xml

Information about the auto-generation of communication.xml can be found in Topics in Asynchronous API

queue_publisher.xml

The queue_publisher.xml file is generated by the \Magento\WebapiAsync\Code\Generator\Config\RemoteServiceReader\Publisher class, which implements \Magento\Framework\Config\ReaderInterface and is injected into the \Magento\Framework\MessageQueue\Publisher\Config\CompositeReader constructor argument in the main di.xml file.

Copied to your clipboard
<type name="Magento\Framework\MessageQueue\Publisher\Config\CompositeReader">
<arguments>
<argument name="readers" xsi:type="array">
<item name="asyncServiceReader" xsi:type="object" sortOrder="0">Magento\WebapiAsync\Code\Generator\Config\RemoteServiceReader\Publisher</item>
...
</argument>
</arguments>
</type>

The sort order is set to 0 and allows developers to change some aspects of the generated configuration in configuration readers such as queue_publisher.xml and env.php.

The \Magento\WebapiAsync\Code\Generator\Config\RemoteServiceReader\Publisher::read() method calls \Magento\AsynchronousOperations\Model\ConfigInterface::getServices() to get an array of REST API routes that can be executed asynchronously. It then dynamically resolves the connection name (db (default), amqp, or stomp for ActiveMQ Artemis) based on the env.php deployment configuration and defines the exchange as magento for each generated topic name.

queue_consumer.xml

The asynchronous/bulk API has one defined consumer which processes all asynchronous/bulk APIs messages.

Copied to your clipboard
<consumer name="async.operations.all" queue="async.operations.all"
consumerInstance="Magento\AsynchronousOperations\Model\MassConsumer"/>

The connection type (AMQP or STOMP) is determined automatically based on your env.php configuration.

queue_topology.xml

The message queue topology configuration links all auto-generated topic names with the async. prefix to the magento exchange. It defines the queue named async.operations.all as the destination for all messages.

Copied to your clipboard
<exchange name="magento">
<binding id="async.operations.all" topic="async.#" destination="async.operations.all"/>
</exchange>
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.