You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/amqp.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ For example, to connect to a virtual host called `tenant-1`, the client sets the
61
61
62
62
An AMQP 1.0 [address](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-address-string) determines where a message is sent to or consumed from.
63
63
What internal object an AMQP address refers to and how an AMQP address is resolved is not defined by the AMQP 1.0 specification.
64
-
Different AMQP 1.0 brokers can choose to interprete the provided address differently.
64
+
Different AMQP 1.0 brokers can choose to interpret the provided address differently.
65
65
66
66
RabbitMQ implements the powerful and flexible [AMQ 0.9.1 model](/tutorials/amqp-concepts) comprising [exchanges](/tutorials/amqp-concepts#exchanges), [queues](/tutorials/amqp-concepts#queues), and [bindings](/tutorials/amqp-concepts#bindings).
67
67
Therefore, AMQP clients talking to RabbitMQ send messages to exchanges and consume messages from queues.
@@ -219,6 +219,23 @@ As explained previously, RabbitMQ 4.0 allows AMQP clients to create RabbitMQ top
219
219
Hence, there is no need for RabbitMQ itself to auto declare a specific queue for a given queue source address format.
220
220
In v2, clients should first declare their own queues and bindings, and then attach with source address `/queues/:queue` which causes the client to consume from that queue.
221
221
222
+
## Message Annotations
223
+
224
+
When a message is delivered to a consumer, RabbitMQ sets at least the following two [message annotations](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-message-annotations):
225
+
*`x-exchange` set to the [exchange](/tutorials/amqp-concepts#exchanges) this message was originally published to.
226
+
*`x-routing-key` set to the routing key this message was originally published with.
227
+
228
+
These message annotations are derived in different ways depending on how the message was originally sent to RabbitMQ. For example, they could be derived from:
229
+
* The `address` field of the [target](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-target) an AMQP 1.0 publisher attached to.
230
+
* The `to` field of the AMQP 1.0 message [properties](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-properties) section.
231
+
* The `exchange` and `routing_key` fields of the AMQP 0.9.1 `basic.publish` frame, if the message was originally published with AMQP 0.9.1.
232
+
* The [topic name](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901107) of an MQTT PUBLISH packet, if the message was originally published with MQTT.
233
+
* The name of the [stream](./streams), if the message was originally published with the [RabbitMQ stream protocol](https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_stream/docs/PROTOCOL.adoc).
234
+
235
+
However, AMQP 1.0 clients should not publish messages with message annotations `x-exchange` or `x-routing-key` to RabbitMQ.
236
+
RabbitMQ will not interpret them.
237
+
Instead, if an AMQP 1.0 client wants to re-publish a message to the original exchange with the original routing key, the [address](#addresses) should be set accordingly.
238
+
222
239
## Outcomes
223
240
224
241
An [outcome](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-delivery-state) indicates the result of delivery (message)
Copy file name to clipboardExpand all lines: versioned_docs/version-4.0/amqp.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ For example, to connect to a virtual host called `tenant-1`, the client sets the
61
61
62
62
An AMQP 1.0 [address](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-address-string) determines where a message is sent to or consumed from.
63
63
What internal object an AMQP address refers to and how an AMQP address is resolved is not defined by the AMQP 1.0 specification.
64
-
Different AMQP 1.0 brokers can choose to interprete the provided address differently.
64
+
Different AMQP 1.0 brokers can choose to interpret the provided address differently.
65
65
66
66
RabbitMQ implements the powerful and flexible [AMQ 0.9.1 model](/tutorials/amqp-concepts) comprising [exchanges](/tutorials/amqp-concepts#exchanges), [queues](/tutorials/amqp-concepts#queues), and [bindings](/tutorials/amqp-concepts#bindings).
67
67
Therefore, AMQP clients talking to RabbitMQ send messages to exchanges and consume messages from queues.
@@ -219,6 +219,23 @@ As explained previously, RabbitMQ 4.0 allows AMQP clients to create RabbitMQ top
219
219
Hence, there is no need for RabbitMQ itself to auto declare a specific queue for a given queue source address format.
220
220
In v2, clients should first declare their own queues and bindings, and then attach with source address `/queues/:queue` which causes the client to consume from that queue.
221
221
222
+
## Message Annotations
223
+
224
+
When a message is delivered to a consumer, RabbitMQ sets at least the following two [message annotations](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-message-annotations):
225
+
*`x-exchange` set to the [exchange](/tutorials/amqp-concepts#exchanges) this message was originally published to.
226
+
*`x-routing-key` set to the routing key this message was originally published with.
227
+
228
+
These message annotations are derived in different ways depending on how the message was originally sent to RabbitMQ. For example, they could be derived from:
229
+
* The `address` field of the [target](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-target) an AMQP 1.0 publisher attached to.
230
+
* The `to` field of the AMQP 1.0 message [properties](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-properties) section.
231
+
* The `exchange` and `routing_key` fields of the AMQP 0.9.1 `basic.publish` frame, if the message was originally published with AMQP 0.9.1.
232
+
* The [topic name](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901107) of an MQTT PUBLISH packet, if the message was originally published with MQTT.
233
+
* The name of the [stream](./streams), if the message was originally published with the [RabbitMQ stream protocol](https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_stream/docs/PROTOCOL.adoc).
234
+
235
+
However, AMQP 1.0 clients should not publish messages with message annotations `x-exchange` or `x-routing-key` to RabbitMQ.
236
+
RabbitMQ will not interpret them.
237
+
Instead, if an AMQP 1.0 client wants to re-publish a message to the original exchange with the original routing key, the [address](#addresses) should be set accordingly.
238
+
222
239
## Outcomes
223
240
224
241
An [outcome](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-delivery-state) indicates the result of delivery (message)
0 commit comments