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
is a plugin that consumes RabbitMQ internal events and re-publishes them to a
43
+
[topic exchange](/tutorials/amqp-concepts#exchange-topic) called `amq.rabbitmq.event`, thus exposing these events to clients applications.
44
+
To consume the events, an application needs to declare a queue and bind it to the `amq.rabbitmq.event` exchange.
69
45
70
-
### RabbitMQ Broker
46
+
By default, the plugin declares the topic exchange `amq.rabbitmq.event` in the default virtual host (`/`).
47
+
All events are published to this exchange with routing keys (topics) such as `exchange.created`, `binding.deleted`, etc.
48
+
Applications can therefore consume only the relevant events.
49
+
For example, to subscribe to all user events (such as `user.created`, `user.authentication.failure`, etc.) create a binding with routing (binding) key `user.#`.
71
50
72
-
Queue, Exchange and Binding events:
51
+
The exchange behaves similarly to `amq.rabbitmq.log`: everything gets published there.
52
+
If application's user cannot be trusted with the events that get published, don't [allow](./access-control) them `read` access to the `amq.rabbitmq.event` exchange.
73
53
74
-
-`queue.created`
75
-
-`queue.deleted`
76
-
-`exchange.created`
77
-
-`exchange.deleted`
78
-
-`binding.created`
79
-
-`binding.deleted`
54
+
::: important
80
55
81
-
Connection and Channel events:
56
+
All messages published by the internal event mechanism will always have a blank body.
57
+
Relevant event attributes are passed in message metadata.
82
58
83
-
-`connection.created`
84
-
-`connection.closed`
85
-
-`channel.created`
86
-
-`channel.closed`
59
+
:::
87
60
88
-
Consumer events:
61
+
Each event has various event properties associated with it.
62
+
By default, the plugin internally publishes AMQP 0.9.1 messages with event properties translated to AMQP 0.9.1 message headers.
63
+
The plugin can optionally be configured to internally publish AMQP 1.0 messages with event properties translated to AMQP 1.0 [message-annotations](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-message-annotations)
64
+
by setting the following in [rabbitmq.conf](configure#config-file):
89
65
90
-
-`consumer.created`
91
-
-`consumer.deleted`
92
-
93
-
Policy and Parameter events:
94
-
95
-
-`policy.set`
96
-
-`policy.cleared`
97
-
-`parameter.set`
98
-
-`parameter.cleared`
99
-
100
-
Virtual host events:
101
-
102
-
-`vhost.created`
103
-
-`vhost.deleted`
104
-
105
-
User related events:
66
+
```
67
+
event_exchange.protocol = amqp_1_0
68
+
```
106
69
107
-
-`user.authentication.success`
108
-
-`user.authentication.failure`
109
-
-`user.created`
110
-
-`user.deleted`
111
-
-`user.password.changed`
112
-
-`user.password.cleared`
113
-
-`user.tags.set`
70
+
All messages published by the internal event mechanism will always have a blank body.
71
+
Relevant event attributes are passed in message metadata.
114
72
115
-
Permission events:
73
+
Because the plugin sets event properties as AMQP 0.9.1 headers or AMQP 1.0 message-annotations, client applications can optionally subscribe to only specific event properties (for example all events emitted for a specific user). This can be achieved by binding a queue to a [headers exchange](/tutorials/amqp-concepts#exchange-headers), and the headers exchange to the `amq.rabbitmq.event` topic exchange.
116
74
117
-
-`permission.created`
118
-
-`permission.deleted`
75
+
### Events
119
76
120
-
### Shovel Plugin
77
+
Events including their routing keys (topics) that this plugin publishes are documented [here](./logging#internal-events).
121
78
122
-
Worker events:
79
+
### Example
123
80
124
-
-`shovel.worker.status`
125
-
-`shovel.worker.removed`
81
+
There's an [example internal event consumer in Java](https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/rabbitmq_event_exchange/examples/java).
126
82
127
-
### Federation Plugin
128
83
129
-
Link events:
84
+
## Plugin Configuration
130
85
131
-
-`federation.link.status`
132
-
-`federation.link.removed`
86
+
By default, the `rabbitmq_event_exchange` plugin uses the following configuration:
133
87
88
+
```ini
89
+
event_exchange.vhost = /
90
+
event_exchange.protocol = amqp_0_9_1
91
+
```
134
92
135
-
## Example
93
+
To switch the plugin to publish events in the AMQP 1.0 format, use
136
94
137
-
There is a usage example using the Java client [in the rabbitmq-event-exchange repository](https://github.com/rabbitmq/rabbitmq-event-exchange/tree/master/examples/java).
0 commit comments