Event Exchange Plugin

RabbitMQ

Features
Get Started
Support
Community
Docs
Blog

Overview

Client connection, channels, queues, consumers, and other parts of the system naturally generate events. For example, when a connection is accepted, authenticated and access to the target virtual host is authorised, it will emit an event of type connection_created. When a connection is closed or fails for any reason, a connection_closed event is deleted.

Monitoring and auditing services can be interested in observing those events. RabbitMQ has a minimalistic mechanism for event notifications that can be exposed to RabbitMQ clients with a plugin.
Consuming Internal Events with rabbitmq-event-exchange Plugin

rabbitmq-event-exchange is a plugin that consumes internal events and re-publishes them to a topic exchange, thus exposing the events to clients (applications).

To consume the events, an application needs to declare a queue, bind it to a special system exchange and consume messages.

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.

The plugin requires no configuration, just activate it:

rabbitmq-plugins enable rabbitmq_event_exchange

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

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 the rabbitmq-event-exchange repository.
Getting Help and Providing Feedback

If you have questions about the contents of this guide or any other topic related to RabbitMQ, don’t hesitate to ask them on the RabbitMQ mailing list.
Help Us Improve the Docs ❤️

If you’d like to contribute an improvement to the site, its source is available on GitHub. Simply fork the repository and submit a pull request. Thank you!
In This Section

Server Documentation
    Configuration
    Management UI
    Monitoring
    Production Checklist
    TLS Support
    Feature Flags
    Distributed RabbitMQ
    Clustering
    Reliable Delivery
    Backup and restore
    Alarms
    Memory Use
    Networking
    Virtual Hosts
    High Availability (pacemaker)
    Access Control (Authorisation)
    Authentication Mechanisms
    LDAP
    Lazy Queues
    Internal Event Exchange
    Firehose (Message Tracing)
    Manual Pages
    Windows Quirks
Client Documentation
Plugins
News
Protocol
Our Extensions
Building
Previous Releases
License

RabbitMQ

Features
Get Started
Support
Community
Docs
Blog

Copyright © 2007-2020 VMware, Inc. or its affiliates. All rights reserved. Terms of Use, Privacy and Trademark Guidelines

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值