Skip to content
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion src/pages/coding-standards/js.md
Original file line number Diff line number Diff line change
@@ -361,4 +361,33 @@ var foo = 'bar',

There is a set of custom Eslint rules to ensure code compatibility with the latest versions of third-party libraries.

These custom rules are included using the `rulePaths` setting in the [Eslint Grunt configuration](https://github.com/magento/magento2/blob/2.4/dev/tools/grunt/configs/eslint.json).
In previous versions of ESLint, these custom rules were included using the `rulePaths` setting in the [ESLint Grunt configuration](https://github.com/magento/magento2/blob/2.4/dev/tools/grunt/configs/eslint.json).

However, since ESLint 9 has deprecated `rulePaths`, you must update the configuration accordingly.

The following example shows the necessary changes to implement custom Eslint rules in the `dev/tools/grunt/configs/eslint.json` file.

```json
{
"file": {
"options": {
"overrideConfigFile": "vendor/magento/magento-coding-standard/eslint/eslint.config.mjs",
"useEslintrc": false
}
},
"test": {
"options": {
"overrideConfigFile": "vendor/magento/magento-coding-standard/eslint/eslint.config.mjs",
"outputFile": "dev/tests/static/eslint-error-report.xml",
"format": "junit",
"quiet": true
}
}
}
```

### Applying custom rules

To add or modify custom rules, update the `eslint.config.mjs` file in the `magento-coding-standard` repository.
In the latest version of ESLint, the configuration has transitioned from using the legacy `.eslintrc` settings to the new flat configuration.
Refer to the [migration guide](https://eslint.org/docs/latest/use/configure/migration-guide) in the ESlint documentation for detailed instructions on migrating to the new format.
Original file line number Diff line number Diff line change
@@ -46,28 +46,36 @@ The `queue_publisher.xml` file is generated by the `\Magento\WebapiAsync\Code\Ge

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`.

`\Magento\WebapiAsync\Code\Generator\Config\RemoteServiceReader\Publisher::read()` calls `\Magento\AsynchronousOperations\Model\ConfigInterface::getServices()` to get an array of all REST API routes which can be executed asynchronously. Then it defines the connection name as `amqp` and the exchange as `magento` for each generated topic name.
`\Magento\WebapiAsync\Code\Generator\Config\RemoteServiceReader\Publisher::read()` calls `\Magento\AsynchronousOperations\Model\ConfigInterface::getServices()` to get an array of all REST API routes which can be executed asynchronously. Then it defines the connection name as `amqp` (or `stomp` for ActiveMQ Artemis) and 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.

```xml
<consumer name="async.operations.all" queue="async.operations.all" connection="amqp"
<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 prefix `async.` to the `magento` exchange and defines the queue named `async.operations.all` as the destination for all messages.

```xml
<exchange name="magento" connection="amqp">
<exchange name="magento">
<binding id="async.operations.all" topic="async.#" destination="async.operations.all"/>
</exchange>
```

The connection type is automatically determined from your `env.php` configuration.

<InlineAlert variant="info" slots="text"/>

Message queues connection is defined dynamically based on deployment configuration in `env.php`. If AMQP or STOMP is configured in deployment configuration of the queue, the respective connection is used. Otherwise, db connection is used.
As a result, if AMQP or STOMP is configured in deployment configuration of the queue, connection declaration can be omitted in [message queue configuration files](./configuration.md): `queue_customer.xml`, `queue_publisher.xml`, `queue_topology.xml`.

<InlineAlert variant="info" slots="text"/>

Message queues connection is defined dynamically based on deployment configuration in `env.php`. If AMQP is configured in deployment configuration of the queue, AMQP connection is used. Otherwise, db connection is used.
As a result, if AMQP is configured in deployment configuration of the queue, connection declaration can be omitted in [message queue configuration files](./configuration.md): `queue_customer.xml`, `queue_publisher.xml`, `queue_topology.xml`.
ActiveMQ Artemis (STOMP) was introduced in Adobe Commerce 2.4.6 and later versions. For STOMP connections, use ANYCAST addressing mode for point-to-point message delivery and load balancing across multiple consumers.
Original file line number Diff line number Diff line change
@@ -319,35 +319,55 @@ The `queue_consumer.xml` file defines the relationship between a queue and its c

```xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd">
<consumer name="<consumer_name>" queue="<queue_name>" connection="amqp" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="<Consumer_Class>::<Consumer_method>"/>
<consumer name="<consumer_name>" queue="<queue_name>" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="<Consumer_Class>::<Consumer_method>"/>
</config>
```

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

### Create `queue_publisher.xml`

The `queue_publisher.xml` file defines the exchange where a topic is published. Create this file with the following contents:

**For RabbitMQ (AMQP):**

```xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
<publisher topic="<topic_name>">
<connection name="amqp" exchange="<exchange>" />
<connection exchange="<exchange>" />
</publisher>
</config>
```

**For ActiveMQ Artemis (STOMP):**

```xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
<publisher topic="<topic_name>" queue="<queue_name>" />
</config>
```

**Note**: For ActiveMQ Artemis, the `<connection>` element is not required as the connection type is determined from `env.php`. When the topic name and queue name are different, you must specify the `queue` attribute in the `<publisher>` element.

### Create `queue_topology.xml`

The `queue_topology.xml` file defines the message routing rules and declares queues and exchanges. Create this file with the following contents:

```xml
<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">
<exchange name="magento" type="topic">
<binding id="defaultBinding" topic="" destinationType="queue" destination="<queue_name>"/>
</exchange>
</config>
```

The connection type is automatically determined from your `env.php` configuration.

<InlineAlert variant="info" slots="text"/>

Message queue connections are defined dynamically, based on the deployment configuration in the `env.php` file. If AMQP or STOMP is configured in the deployment configuration of the queue, the respective connection is used. Otherwise, database connections are used.
As a result, if AMQP or STOMP is configured in the deployment configuration of the queue, you can omit connection declarations in the `queue_consumer.xml`, `queue_publisher.xml`, and `queue_topology.xml` [message queue configuration files](./configuration.md).

<InlineAlert variant="info" slots="text"/>

Message queue connections are defined dynamically, based on the deployment configuration in the `env.php` file. If AMQP is configured in the deployment configuration of the queue, AMQP connections are used. Otherwise, database connections are used.
As a result, if AMQP is configured in the deployment configuration of the queue, you can omit connection declarations in the `queue_consumer.xml`, `queue_publisher.xml`, and `queue_topology.xml` [message queue configuration files](./configuration.md).
ActiveMQ Artemis (STOMP) was introduced in Adobe Commerce 2.4.6 and later versions. For STOMP connections, use ANYCAST addressing mode for point-to-point message delivery and load balancing across multiple consumers.
36 changes: 29 additions & 7 deletions src/pages/development/components/message-queues/configuration.md
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ Depending on your needs, you may only need to create and configure `communicatio

## `communication.xml`

The `<module>/etc/communication.xml` file defines aspects of the message queue system that all communication types have in common. This release supports AMQP and database connections.
The `<module>/etc/communication.xml` file defines aspects of the message queue system that all communication types have in common. This release supports AMQP, STOMP, and database connections.

### Example

@@ -81,8 +81,8 @@ The `queue_consumer.xml` file contains one or more `consumer` elements:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd">
<consumer name="basic.consumer" queue="basic.consumer.queue" handler="LoggerClass::log"/>
<consumer name="synchronous.rpc.test" queue="synchronous.rpc.test.queue" handler="LoggerClass::log"/>
<consumer name="rpc.test" queue="queue.for.rpc.test.unused.queue" consumerInstance="Magento\Framework\MessageQueue\BatchConsumer" connection="amqp"/>
<consumer name="test.product.delete" queue="queue.for.test.product.delete" connection="amqp" handler="Magento\Queue\Model\ProductDeleteConsumer::processMessage" maxMessages="200" maxIdleTime="180" sleep="60" onlySpawnWhenMessageAvailable="0"/>
<consumer name="rpc.test" queue="queue.for.rpc.test.unused.queue" consumerInstance="Magento\Framework\MessageQueue\BatchConsumer"/>
<consumer name="test.product.delete" queue="queue.for.test.product.delete" handler="Magento\Queue\Model\ProductDeleteConsumer::processMessage" maxMessages="200" maxIdleTime="180" sleep="60" onlySpawnWhenMessageAvailable="0"/>
</config>
```

@@ -94,7 +94,7 @@ The `queue_consumer.xml` file contains one or more `consumer` elements:
| queue (required) | Defines the queue name to send the message to. |
| handler | Specifies the class and method that processes the message. The value must be specified in the format `<Vendor>\Module\<ServiceName>::<methodName>`.|
| consumerInstance | The class name that consumes the message. Default value: `Magento\Framework\MessageQueue\Consumer`. |
| connection | Connection is defined dynamically based on deployment configuration of message queue in `env.php`. If AMQP is configured in deployment configuration, AMQP connection is used. Otherwise, db connection is used. If you still want to specify connection type for consumer, keep in mind that for AMQP connections, the connection name must match the `connection` attribute in the `queue_topology.xml` file. Otherwise, the connection name must be `db`. |
| connection | Connection is defined dynamically based on deployment configuration of message queue in `env.php`. If AMQP or STOMP is configured in deployment configuration, the respective connection is used. Otherwise, db connection is used. If you still want to specify connection type for consumer, keep in mind that for AMQP connections, the connection name must match the `connection` attribute in the `queue_topology.xml` file. For STOMP connections, use `stomp`. Otherwise, the connection name must be `db`. |
| maxMessages | Specifies the maximum number of messages to consume.|
| maxIdleTime | Defines the maximum waiting time in seconds for a new message from the queue. If no message was handled within this period of time, the consumer exits. Default value: `null`|
| sleep | Specifies time in seconds to sleep before checking if a new message is available in the queue. Default value is `null` which equals to 1 second.|
@@ -178,7 +178,7 @@ The `queue_topology.xml` file defines the message routing rules and declares que
| -------------- | ----------- |
name (required) | A unique ID for the exchange.
type | Specifies the type of exchange. The default value is `topic` because only `topic` type is supported.
connection (required) | Connection is defined dynamically based on deployment configuration of message queue in `env.php`. If AMQP is configured in deployment configuration, AMQP connection is used. Otherwise, db connection is used. If you still want to specify connection, the connection name must be `amqp` for AMQP. For MySQL connections, the connection name must be `db`.
connection (required) | Connection is defined dynamically based on deployment configuration of message queue in `env.php`. If AMQP or STOMP is configured in deployment configuration, the respective connection is used. Otherwise, db connection is used. If you still want to specify connection, the connection name must be `amqp` for AMQP, `stomp` for STOMP. For MySQL connections, the connection name must be `db`.
durable | Boolean value indicating whether the exchange is persistent. Non-durable exchanges are purged when the server restarts. The default is `true`.
autoDelete | Boolean value indicating whether the exchange is deleted when all queues have finished using it. The default is `false`.
internal | Boolean value. If set to true, the exchange may not be used directly by publishers, but only when bound to other exchanges. The default is `false`.
@@ -233,6 +233,8 @@ The `queue_publisher.xml` file defines which connection and exchange to use to p

### Example

__For RabbitMQ (AMQP):__

```xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
@@ -244,27 +246,47 @@ The `queue_publisher.xml` file defines which connection and exchange to use to p
</config>
```

__For ActiveMQ Artemis (STOMP):__

```xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
<publisher topic="magento.testModuleSynchronousAmqp.api.serviceInterface.execute" disabled="true" />
<publisher topic="asynchronous.test" queue="async.test.queue">
<connection name="stomp" disabled="false"/>
<connection name="db" disabled="true"/>
</publisher>
</config>
```

#### `publisher` element

| Attribute | Description |
| -------------------- | ----------- |
| topic (required) | The name of the topic. |
| queue | For ActiveMQ Artemis (STOMP), specify the queue name when it differs from the topic name. |
| disabled | Determines whether this queue is disabled. The default value is `false`. |

#### `connection` element

The `connection` element is a subnode of the `publisher` element. There must not be more than one enabled active connection to a publisher defined at a time. If you omit the `connection` element, connection will be defined dynamically based on deployment configuration of message queue in `env.php` and exchange `magento` will be used. If AMQP is configured in deployment configuration, AMQP connection is used. Otherwise, db connection is used.
The `connection` element is a subnode of the `publisher` element. There must not be more than one enabled active connection to a publisher defined at a time. If you omit the `connection` element, connection will be defined dynamically based on deployment configuration of message queue in `env.php` and exchange `magento` will be used. If AMQP or STOMP is configured in deployment configuration, the respective connection is used. Otherwise, db connection is used.

| Attribute | Description |
| -------------------- | ----------- |
| name | Connection name is defined dynamically based on deployment configuration of message queue in `env.php`. If you still want to specify connection type for publisher, keep in mind that for AMQP connections, the connection name must match the `connection` attribute in the `queue_topology.xml` file. Otherwise, the connection name must be `db`. |
| name | Connection name is defined dynamically based on deployment configuration of message queue in `env.php`. If you still want to specify connection type for publisher, keep in mind that for AMQP connections, the connection name must match the `connection` attribute in the `queue_topology.xml` file. For STOMP connections, use `stomp`. Otherwise, the connection name must be `db`. |
| exchange | The name of the exchange to publish to. The default system exchange name is `magento`. |
| disabled | Determines whether this queue is disabled. The default value is `false`. |

<InlineAlert variant="warning" slots="text"/>

You cannot enable more than one `publisher` for each `topic`.

## ActiveMQ Artemis (STOMP) Support

<InlineAlert variant="info" slots="text"/>

ActiveMQ Artemis (STOMP) support was introduced in Adobe Commerce 2.4.6 and later versions. For STOMP connections, use ANYCAST addressing mode for point-to-point message delivery and load balancing across multiple consumers.

## Updating `queue.xml`

See [Migrate message queue configuration](migration.md) for information about upgrading from Adobe Commerce and Magento Open Source 2.0 or 2.1.
50 changes: 47 additions & 3 deletions src/pages/development/components/message-queues/index.md
Original file line number Diff line number Diff line change
@@ -9,9 +9,12 @@ keywords:

Message queues provide an asynchronous communications mechanism in which the sender and the receiver of a message do not contact each other, nor do they need to communicate with the message queue at the same time. When a sender places a message onto a queue, it is stored until the recipient receives them.

In Adobe Commerce and Magento Open Source, the Message Queue Framework (MQF) is a fully-functional system that allows a module to publish messages to queues. It also creates consumers to receive them asynchronously. The MQF primarily uses [RabbitMQ](http://www.rabbitmq.com) as the messaging broker, which provides a scalable platform for sending and receiving messages. It also includes a mechanism for storing undelivered messages. RabbitMQ is based on the Advanced Message Queuing Protocol (AMQP) 0.9.1 specification.
In Adobe Commerce and Magento Open Source, the Message Queue Framework (MQF) is a fully-functional system that allows a module to publish messages to queues. It also creates consumers to receive them asynchronously. The MQF supports multiple messaging brokers:

A basic message queue system can also be set up without using RabbitMQ. In this system, a MySQL adapter stores messages in the database. Three database tables (`queue`, `queue_message`, and `queue_message_status`) manage the message queue workload. Cron jobs ensure the consumers are able to receive messages. This solution is not very scalable. RabbitMQ should be used whenever possible.
- **[RabbitMQ](http://www.rabbitmq.com)** - The primary messaging broker, which provides a scalable platform for sending and receiving messages. It includes a mechanism for storing undelivered messages and is based on the Advanced Message Queuing Protocol (AMQP) 0.9.1 specification.
- **[Apache ActiveMQ Artemis](https://activemq.apache.org/components/artemis/)** - An alternative messaging broker that uses the STOMP (Simple Text Oriented Messaging Protocol) for reliable and scalable messaging, offering flexibility for STOMP-based integrations.

A basic message queue system can also be set up without using external message brokers. In this system, a MySQL adapter stores messages in the database. Three database tables (`queue`, `queue_message`, and `queue_message_status`) manage the message queue workload. Cron jobs ensure the consumers are able to receive messages. This solution is not very scalable. External message brokers like RabbitMQ or ActiveMQ Artemis should be used whenever possible.

See [Configure message queues](configuration.md) for information about setting up the message queue system.

@@ -49,7 +52,11 @@ Perform the following actions:
1. Decode the message using topic name taken from the `\Magento\Framework\MessageQueue\ConsumerConfigurationInterface`.
1. Invoke callback `Magento\Framework\MessageQueue\ConsumerConfigurationInterface::getCallback` and pass the decoded data as an argument.

## Change message queue from MySQL to AMQP
### ActiveMQ Artemis (STOMP)

Similar to RabbitMQ, ActiveMQ Artemis instantiates a consumer that is defined in a [`queue_consumer.xml`](configuration.md#queue_consumerxml) file. The consumer (`customer_created_listener`) listens to the queue and receives all new messages. For every message, it invokes `Magento\Some\Class::processMessage($message)`

## Change message queue from MySQL to external brokers

The following sample introduces a runtime configuration that allows you to redefine the adapter for a topic.

@@ -85,3 +92,40 @@ The following sample introduces a runtime configuration that allows you to redef
],
],
```

### Switch from MySQL to STOMP (ActiveMQ Artemis)

The following configuration shows how to configure a topic to use STOMP instead of MySQL:

```php
'queue' => [
'topics' => [
'inventory.update' => [
'publisher' => 'stomp-magento'
]
],
'config' => [
'publishers' => [
'inventory.update' => [
'connections' => [
'stomp' => [
'name' => 'stomp',
'exchange' => 'magento',
'disabled' => false
],
'db' => [
'name' => 'db',
'exchange' => 'magento',
'disabled' => true
]
]
]
]
],
'consumers' => [
'inventory.update' => [
'connection' => 'stomp',
],
]
],
```
225 changes: 219 additions & 6 deletions src/pages/development/components/message-queues/migration.md
Original file line number Diff line number Diff line change
@@ -8,13 +8,226 @@ keywords:

# Migrate message queue configuration

## Migrate from 2.4.5 to 2.4.6, 2.4.7, 2.4.8, 2.4.9

Adobe Commerce 2.4.9 introduced support for Apache ActiveMQ Artemis (STOMP) as an alternative message broker to RabbitMQ (AMQP). This feature was also backported to versions 2.4.6, 2.4.7, and 2.4.8. When upgrading from 2.4.5 (or earlier) to 2.4.6 or later versions, you have the option to continue using RabbitMQ or migrate to ActiveMQ Artemis.

### Key Changes in 2.4.6+

- **ActiveMQ Artemis (STOMP) Support**: New message broker option alongside RabbitMQ (introduced in 2.4.9, backported to 2.4.6, 2.4.7, 2.4.8)
- **Extended Dynamic Connection Detection**: Existing dynamic connection detection now supports STOMP in addition to AMQP
- **Enhanced SSL Configuration**: Improved SSL options for both brokers
- **Multiple Named Connections**: Enhanced support for configuring multiple broker connections

### Configuration File Changes

The following table shows the key differences between 2.4.5 and 2.4.6+ configurations:

| Configuration Area | 2.4.5 | 2.4.6+ |
| ------------------ | ----- | ------ |
| `env.php` default_connection | Optional when single broker configured | Optional when single broker configured; required when multiple brokers (can be `'amqp'`, `'stomp'`, or `'db'`) |
| `env.php` broker configuration | RabbitMQ (AMQP) only | RabbitMQ (AMQP) and/or ActiveMQ Artemis (STOMP) |
| `queue_consumer.xml` connection attribute | Optional (auto-detected from env.php) | Optional (auto-detected, now includes STOMP in 2.4.6+) |
| `queue_publisher.xml` connection element | Optional for AMQP, supports multiple connections | Optional for AMQP/STOMP, enhanced multiple connections |
| `queue_topology.xml` connection attribute | Optional (auto-detected from env.php) | Optional (auto-detected, now includes STOMP in 2.4.6+) |

### Update `env.php` Configuration

**For RabbitMQ (AMQP) - No Changes Required:**

```php
'queue' => [
'amqp' => [
'host' => 'rabbitmq.example.com',
'port' => '5672',
'user' => 'magento',
'password' => 'magento',
'virtualhost' => '/',
'ssl' => false
]
]
```

**For ActiveMQ Artemis (STOMP) - Available in 2.4.6+ (introduced in 2.4.9, backported to 2.4.6-2.4.8):**

```php
'queue' => [
'stomp' => [
'host' => 'activemq.example.com',
'port' => '61613',
'user' => 'artemis',
'password' => 'artemis',
'ssl' => false
]
]
```

**For Both Brokers - Available in 2.4.6+ (requires `default_connection`):**

```php
'queue' => [
'default_connection' => 'amqp', // Required when multiple brokers are configured
'amqp' => [
'host' => 'rabbitmq.example.com',
'port' => '5672',
'user' => 'magento',
'password' => 'magento',
'virtualhost' => '/',
'ssl' => false
],
'stomp' => [
'host' => 'activemq.example.com',
'port' => '61613',
'user' => 'artemis',
'password' => 'artemis',
'ssl' => false
]
]
```

<InlineAlert variant="info" slots="text"/>

The `default_connection` parameter is only required when multiple message brokers are configured. When only one broker (AMQP or STOMP) is configured, the system automatically uses the available broker.

<InlineAlert variant="info" slots="text"/>

The `connection` attribute in XML configuration files (`queue_consumer.xml`, `queue_publisher.xml`, `queue_topology.xml`) is optional when you want to use the default broker from `env.php`. However, you can explicitly specify `connection="amqp"` or `connection="stomp"` when you want a particular module or functionality to use a specific broker, even when multiple brokers are configured.

### Update `queue_consumer.xml` Files

The first column in the following table lists parameters in 2.4.6+ `queue_consumer.xml` files. The second column shows the equivalent in 2.4.5.

| 2.4.6+ Attribute | 2.4.5 Equivalent | Notes |
| ----------------- | ----------------- | ----- |
| `<consumer>/name` | `<consumer>/name` | No change |
| `<consumer>/queue` | `<consumer>/queue` | No change |
| `<consumer>/handler` | `<consumer>/handler` | No change |
| `<consumer>/consumerInstance` | `<consumer>/consumerInstance` | No change |
| `<consumer>/connection` | `<consumer>/connection` | Optional in both versions, auto-detected from env.php. In 2.4.6+ also supports STOMP. Use explicitly to force specific broker selection. |
| `<consumer>/maxMessages` | `<consumer>/maxMessages` | No change |

**2.4.5 Example:**

```xml
<consumer name="example.consumer" queue="example.queue" connection="amqp" maxMessages="100" />
```

**2.4.6+ Example (Uses default broker from env.php):**

```xml
<consumer name="example.consumer" queue="example.queue" maxMessages="100" />
```

**2.4.6+ Example (Explicitly specifies broker):**

```xml
<!-- Force this consumer to use AMQP even if multiple brokers are configured -->
<consumer name="example.consumer" queue="example.queue" connection="amqp" maxMessages="100" />

<!-- Force this consumer to use STOMP even if multiple brokers are configured -->
<consumer name="example.consumer" queue="example.queue" connection="stomp" maxMessages="100" />
```

### Update `queue_publisher.xml` Files

The first column in the following table lists parameters in 2.4.6+ `queue_publisher.xml` files. The second column shows the equivalent in 2.4.5.

| 2.4.6+ Attribute | 2.4.5 Equivalent | Notes |
| ----------------- | ----------------- | ----- |
| `<publisher>/topic` | `<publisher>/topic` | No change |
| `<publisher>/queue` | Not available | Available in 2.4.6+ for ActiveMQ Artemis |
| `<publisher>/disabled` | `<publisher>/disabled` | No change |
| `<publisher>/<connection>/name` | `<publisher>/<connection>/name` | Can specify `stomp` for ActiveMQ (2.4.6+) |
| `<publisher>/<connection>/exchange` | `<publisher>/<connection>/exchange` | Not used with STOMP |
| `<publisher>/<connection>/disabled` | `<publisher>/<connection>/disabled` | Enhanced in 2.4.6+ for multiple connections |

**2.4.5 Example (RabbitMQ only):**

```xml
<publisher topic="example.topic">
<connection name="amqp" exchange="magento" />
</publisher>
```

**2.4.6+ Example (RabbitMQ):**

```xml
<publisher topic="example.topic">
<connection name="amqp" exchange="magento" disabled="false"/>
<connection name="db" disabled="true"/>
</publisher>
```

**2.4.6+ Example (ActiveMQ Artemis):**

```xml
<publisher topic="example.topic" queue="example.queue">
<connection name="stomp" disabled="false"/>
<connection name="db" disabled="true"/>
</publisher>
```

### Update `queue_topology.xml` Files

The first column in the following table lists parameters in 2.4.6+ `queue_topology.xml` files. The second column shows the equivalent in 2.4.5.

| 2.4.6+ Attribute | 2.4.5 Equivalent | Notes |
| ----------------- | ----------------- | ----- |
| `<exchange>/name` | `<exchange>/name` | No change |
| `<exchange>/type` | `<exchange>/type` | No change |
| `<exchange>/connection` | `<exchange>/connection` | Optional in both versions, auto-detected from env.php. In 2.4.6+ also supports STOMP. Use explicitly to force specific broker selection. |
| `<exchange>/durable` | `<exchange>/durable` | No change |
| `<exchange>/autoDelete` | `<exchange>/autoDelete` | No change |
| `<exchange>/<binding>/id` | `<exchange>/<binding>/id` | No change |
| `<exchange>/<binding>/topic` | `<exchange>/<binding>/topic` | No change |
| `<exchange>/<binding>/destinationType` | `<exchange>/<binding>/destinationType` | No change |
| `<exchange>/<binding>/destination` | `<exchange>/<binding>/destination` | No change |

**2.4.5 Example:**

```xml
<exchange name="magento" type="topic" connection="amqp">
<binding id="example.binding" topic="example.topic" destinationType="queue" destination="example.queue"/>
</exchange>
```

**2.4.6+ Example (Uses default broker from env.php):**

```xml
<exchange name="magento" type="topic">
<binding id="example.binding" topic="example.topic" destinationType="queue" destination="example.queue"/>
</exchange>
```

**2.4.6+ Example (Explicitly specifies broker):**

```xml
<!-- Force this exchange to use AMQP even if multiple brokers are configured -->
<exchange name="magento" type="topic" connection="amqp">
<binding id="example.binding" topic="example.topic" destinationType="queue" destination="example.queue"/>
</exchange>

<!-- Force this exchange to use STOMP even if multiple brokers are configured -->
<exchange name="magento" type="topic" connection="stomp">
<binding id="example.binding" topic="example.topic" destinationType="queue" destination="example.queue"/>
</exchange>
```

<InlineAlert variant="info" slots="text"/>

Connection detection has always been dynamic based on your `env.php` configuration. If AMQP is configured in deployment configuration, the AMQP connection is used automatically. In 2.4.6+, this same dynamic detection was extended to support STOMP connections. This allows you to omit connection declarations in XML configuration files.

<InlineAlert variant="info" slots="text"/>

ActiveMQ Artemis (STOMP) was introduced in Adobe Commerce 2.4.9 and backported to versions 2.4.6, 2.4.7, and 2.4.8. For STOMP connections, use ANYCAST addressing mode for point-to-point message delivery and load balancing across multiple consumers.

## Migrate from 2.1 to 2.2

To upgrade the message queues for Adobe Commerce or Magento Open Source 2.1, you must create the following files in the `<module>/etc` directory for each module that will use the message queue framework.

* `queue_consumer.xml` - Defines the relationship between an existing queue and its consumer.
* `queue_topology.xml`- Defines the message routing rules and declares queues and exchanges.
* `queue_publisher.xml` - Defines the exchange where a topic is published.
- `queue_consumer.xml` - Defines the relationship between an existing queue and its consumer.
- `queue_topology.xml`- Defines the message routing rules and declares queues and exchanges.
- `queue_publisher.xml` - Defines the exchange where a topic is published.

The existing `queue.xml` file is deprecated.

@@ -72,9 +285,9 @@ The first column in the following table lists the all the parameters in the `que

To upgrade from Adobe Commerce or Magento Open Source 2.0, you must create the following files in the `<module>/etc` directory for each module that will use the message queue framework.

* `queue_consumer.xml` - Defines the relationship between an existing queue and its consumer.
* `queue_topology.xml`- Defines the message routing rules.
* `queue_publisher.xml` - Defines the relationship between a topic and its publisher.
- `queue_consumer.xml` - Defines the relationship between an existing queue and its consumer.
- `queue_topology.xml`- Defines the message routing rules.
- `queue_publisher.xml` - Defines the relationship between a topic and its publisher.

The existing `queue.xml` file is deprecated.

2 changes: 1 addition & 1 deletion src/pages/module-reference/module-cms.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ The CMS module provides the create, edit, and manage functionality on pages for

### Wysiwyg

The Wysiwyg UI component is a customizable and configurable TinyMCE editor.
The Wysiwyg UI component is a customizable and configurable HugeRTE editor.

The default implementation has the following customizations: