Configure message queue topology
The message queue topology can only be configured after Magento Open Source has been installed and before Magento Commerce has been installed.
Each module that is to be a publisher
must be configured as such. If you want a module to use the MQF, create a
<module>/etc/queue.xml file and define the publisher, consumers, exchanges and bindings.
queue.xml file can contain the following elements:
queue.xml file must contain the following lines:
publisher element configures the type of connection and the exchange to publish to. By default, Magento uses one exchange. The name of exchange is a part of the publisher configuration. However multiple exchanges are supported, based on the AMQP model.
|name||A unique identifer for the publisher. The value is specified in a
|connection||If RabbitMQ is to used to manage the queue, then the value must be
|exchange||The name of the exchange to publish to. The value is referenced from the
topic element defines the interface that processes the message and assigns a publisher.
The name assigned to the topic. The format should be
The value is specified in a
The interface that describes the structure of the message. It should be in the format of a Data Interface from the Service Contracts. For example,
You can also specify a service method signature, such as
consumer elements maps the receiver of a message to a specific queue. The
method parameters indicate what receives and processes the message.
|name||The name of the consumer. The value should be the same as the magic method that to be used as a callback.|
|queue||Defines the queue name to send the message to. This value is used in the definition of a
|class||The path to a Magento class that consumes the message.|
|method||The method within the specified
|max_messages||Specifies the maximum number of messages to consume.|
bind elements link topics to queues and exchanges, defining the message queue topology. A topic can be sent to any number of queues.