rabbitmq-server/deps/rabbitmq_event_exchange
Michael Klishin b99fb2e7db Merge branch 'master' into rabbitmq-delayed-message-exchange-3 2016-06-02 16:26:54 +03:00
..
examples/java Initial commit 2014-02-06 12:40:35 +00:00
src Stub for type specific exchange info 2016-05-20 12:09:52 +01:00
test/src Do not use time_compat 2016-05-12 10:27:21 +01:00
.gitignore Use relative paths in .gitignore 2015-12-28 18:45:04 +03:00
.travis.yml Use erlang 18.3 only in travis 2016-05-12 10:58:25 +01:00
CODE_OF_CONDUCT.md Update CONTRIBUTING.md, add CODE_OF_CONDUCT.md 2016-05-28 09:53:56 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md, add CODE_OF_CONDUCT.md 2016-05-28 09:53:56 -07:00
LICENSE Initial commit 2014-02-06 12:40:35 +00:00
LICENSE-MPL-RabbitMQ Update (c) info 2016-01-01 12:59:17 +03:00
Makefile Remove `rabbit` from the DEPS 2015-12-21 17:34:58 +01:00
README.md Update README.md 2016-02-04 03:13:19 +03:00
build.config Sync with upstream build.config 2015-12-18 20:33:03 +01:00
erlang.mk Update erlang.mk 2015-12-18 20:33:51 +01:00
rabbitmq-components.mk Update rabbitmq-components.mk 2016-05-29 23:21:54 +03:00

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.deleted
  • queue.created
  • exchange.created
  • exchange.deleted
  • binding.created
  • binding.deleted

Connection and Channel events:

  • connection.created
  • connection.closed
  • channel.created
  • channel.closed

Consumer events:

  • consumer.created
  • consumer.deleted

Policy and Parameter events:

  • policy.set
  • policy.cleared
  • parameter.set
  • parameter.cleared

Virtual host events:

  • vhost.created
  • vhost.deleted

User related events:

  • user.authentication.success
  • user.authentication.failure
  • user.created
  • user.deleted
  • user.password.changed
  • user.password.cleared
  • user.tags.set

Permission events:

  • permission.created
  • permission.deleted

Shovel Plugin

Worker events:

  • shovel.worker.status
  • shovel.worker.removed

Federation Plugin

Link events:

  • federation.link.status
  • federation.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.