This was migrated to https://github.com/rabbitmq/rabbitmq-server
This repository has been moved to the main unified RabbitMQ "monorepo", including all open issues. You can find the source under /deps/rabbitmq_event_exchange. All issues have been transferred.
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.
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.
Most recent RabbitMQ version ships with this plugin.
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_exchangeYou can download a pre-built binary of this plugin from the RabbitMQ Community Plugins page.
Then run the following command:
rabbitmq-plugins enable rabbitmq_event_exchangeEach 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.
So far RabbitMQ and related plugins emit events with the following routing keys:
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.deletedvhost.limits.setvhost.limits.cleared
User related events:
user.authentication.successuser.authentication.failureuser.createduser.deleteduser.password.changeduser.password.cleareduser.tags.set
Permission events:
permission.createdpermission.deletedtopic.permission.createdtopic.permission.deleted
Alarm events:
alarm.setalarm.cleared
Worker events:
shovel.worker.statusshovel.worker.removed
Link events:
federation.link.statusfederation.link.removed
There is a usage example using the Java client in examples/java.
rabbitmq_event_exchange.vhost: what vhost should theamq.rabbitmq.eventexchange be declared in. Default:rabbit.default_vhost(<<"/">>).
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).'
Building is no different from building other RabbitMQ plugins.
TL;DR:
git clone https://github.saobby.my.eu.org.com/rabbitmq/rabbitmq-public-umbrella.git umbrella
cd umbrella
make co
make up BRANCH=stable
cd deps
git clone https://github.com/rabbitmq/rabbitmq-event-exchange.git rabbitmq_event_exchange
cd rabbitmq_event_exchange
make dist
Released under the Mozilla Public License 2.0, the same as RabbitMQ.