Commit Graph

16 Commits

Author SHA1 Message Date
David Ansari de804d1fa7 Support publishing AMQP 1.0 to Event Exchange
## What?

Prior to this commit, the `rabbitmq_event_exchange` internally published
always AMQP 0.9.1 messages to the `amq.rabbitmq.event` topic exchange.
This commit allows users to configure the plugin to publish AMQP 1.0
messages instead.

 ## Why?

Prior to this commit, when an AMQP 1.0 client consumed events,
event properties that are lists were omitted. For example property
`client_properties` of event `connection.created` or property
`arguments` of event `queue.created` were omitted because of the following sequence:
1. The event exchange plugins listens for all kind of internal events.
2. The event exchange plugin re-publishes all events as AMQP 0.9.1 message to the event exchange.
3. Later, when an AMQP 1.0 client consumes this message, the broker must translate the message from AMQP 0.9.1 to AMQP 1.0.
4. This translation follows the rules outlined in https://www.rabbitmq.com/docs/conversions#amqpl-amqp
5. Specifically, in this table the row before the last one describes the rule we're hitting here. It says that if the AMQP 0.9.1
header value is not an `x-` prefixed header and its value is an array or table, then this header is not converted.
That's because AMQP 1.0 application-properties must be simple types as mandated in https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-application-properties

 ## How?

The user can configure the plugin as follows to have the plugin
internally publish AMQP 1.0 messages:
```
event_exchange.protocol = amqp_1_0
```

To support complex types such as lists, the plugin sets all event
properties as AMQP 1.0 message-annotations. The plugin prefixes all message
annotation keys with `x-opt-` to comply with the AMQP 1.0 spec.

 ## Alternative Design

An alternative design would have been to format all event properties
e.g. as JSON within the message body. However, this breaks routing on
specific event property values via a headers exchange.

 ## Documentation
https://github.com/rabbitmq/rabbitmq-website/pull/2129
2024-11-14 12:52:09 +01:00
David Ansari f55cd21e52 Add AMQP 1.0 event exchange test 2024-10-29 12:04:09 +01:00
Loïc Hoguin dc70cbf281
Update Erlang.mk and switch to new xref code 2022-05-31 13:51:12 +02:00
Philip Kuryloski a63f169fcb Remove duplicate rabbitmq-components.mk and erlang.mk files
Also adjust the references in rabbitmq-components.mk to account for
post monorepo locations
2021-03-22 15:40:19 +01:00
Jean-Sébastien Pédron a0c79936dd Merge branch 'stable' 2017-05-16 18:04:54 +02:00
Jean-Sébastien Pédron e22be5b26d Makefile: Load the new `rabbitmq-early-plugin.mk` early-stage plugin
See the corresponding commit in rabbitmq-common for an explanation.

[#144697185]
2017-05-16 17:32:41 +02:00
Jean-Sébastien Pédron be5fddad8f Merge branch 'stable' 2016-12-07 15:37:06 +01:00
Jean-Sébastien Pédron 1d59b9cb2a Move from .app.src to Makefile variables
This is the recommended way with Erlang.mk.

By default, the version is inherited from rabbitmq-server-release when
the source archive is created, or computed from git-describe(1) (see
`rabbitmq-components.mk`). One can override the version from the command
line by setting the `PROJECT_VERSION` variable.

[#130992027]
2016-12-06 15:59:48 +01:00
Jean-Sébastien Pédron 51abe101ff Add rabbitmq_ct_client_helpers to TEST_DEPS 2016-11-24 10:17:43 +01:00
Jean-Sébastien Pédron 6e56d54bb1 Makefile: Explicitely list all DEPS
Sync rabbitmq-components.mk with rabbitmq-common to remove automatic
DEPS handling.

[#130086871]
2016-09-19 13:48:10 +02:00
Jean-Sébastien Pédron f117a555df Makefile: No need to filter out rabbitmq_test from TEST_DEPS anymore
[#127356157]
2016-09-02 12:25:53 +02:00
kjnilsson fcccb89824 migrate to common_test
- rename suites
- add travis configuration
2016-06-16 11:12:38 +01:00
Jean-Sébastien Pédron 4d26110435 Remove `rabbit` from the DEPS 2015-12-21 17:34:58 +01:00
Jean-Sébastien Pédron b50fd7ffa1 `amqp_client` is a TEST_DEPS 2015-12-01 18:17:59 +01:00
Michael Klishin a1d6c5b24d Upgrade to erlang.mk and RabbitMQ 3.6.0 2015-11-30 20:33:54 +03:00
Simon MacMullen 5f58b02f90 Initial commit 2014-02-06 12:40:35 +00:00