|
|
||
|---|---|---|
| .. | ||
| examples/java | ||
| src | ||
| test/src | ||
| .gitignore | ||
| .travis.yml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| LICENSE-MPL-RabbitMQ | ||
| Makefile | ||
| README.md | ||
| build.config | ||
| erlang.mk | ||
| rabbitmq-components.mk | ||
README.md
RabbitMQ Event Exchange
Overview
This plugin exposes the internal RabbitMQ event mechanism as messages that clients can consume. It's useful if you want to keep track of certain events, e.g. when queues, exchanges, bindings, users, connections, channels are created and deleted. This plugin filters out stats events, so you are almost certainly going to get better results using the management plugin for stats.
How it Works
It declares a topic exchange called 'amq.rabbitmq.event' in the default virtual host. All events are published to this exchange with routing keys like 'exchange.created', 'binding.deleted' etc, so you can subscribe to only the events you're interested in.
The exchange behaves similarly to 'amq.rabbitmq.log': everything gets published there; if you don't trust a user with the information that gets published, don't allow them access.
Installation
RabbitMQ 3.6.0 or later
As of RabbitMQ 3.6.0 this plugin is included into the RabbitMQ distribution.
Enable it with the following command:
rabbitmq-plugins enable rabbitmq_event_exchange
You'd probably want to also enable the Consistent Hash Exchange plugin, too.
With Earlier Versions
Install the corresponding .ez files from our Community Plugins archive.
Then run the following command:
rabbitmq-plugins enable rabbitmq_event_exchange
Configuration
The plugin requires no configuration.
Building From Source
Building is no different from building other RabbitMQ plugins.
TL;DR:
git clone https://github.com/rabbitmq/rabbitmq-event-exchange.git
cd rabbitmq-event-exchange
make -j dist
ls plugins/*
Event format
Each event has various properties associated with it. These are translated into AMQP 0-9-1 data encoding and inserted in the message headers. The message body is always blank.
Events
So far RabbitMQ and related plugins emit events with the following routing keys:
RabbitMQ Broker
Queue, Exchange and Binding events:
queue.deletedqueue.createdexchange.createdexchange.deletedbinding.createdbinding.deleted
Connection and Channel events:
connection.createdconnection.closedchannel.createdchannel.closed
Consumer events:
consumer.createdconsumer.deleted
Policy and Parameter events:
policy.setpolicy.clearedparameter.setparameter.cleared
Virtual host events:
vhost.createdvhost.deleted
User related events:
user.authentication.successuser.authentication.failureuser.createduser.deleteduser.password.changeduser.password.cleareduser.tags.set
Permission events:
permission.createdpermission.deleted
Shovel Plugin
Worker events:
shovel.worker.statusshovel.worker.removed
Federation Plugin
Link events:
federation.link.statusfederation.link.removed
Example
There is a usage example using the Java client in examples/java.
Uninstalling
If you want to remove the exchange which this plugin creates, first disable the plugin and restart the broker. Then you can delete the exchange, e.g. with :
rabbitmqctl eval 'rabbit_exchange:delete(rabbit_misc:r(<<"/">>, exchange, <<"amq.rabbitmq.event">>), false).'
License
Released under the Mozilla Public License 1.1, the same as RabbitMQ.