RabbitHub Management is a Rabbitmq Management Plugin for the RabbitHub Plugin RabbitHub is a Webhooks Pub/Sub Plugin for Rabbitmq Tested with Rabbitmq 3.6.1 3.6.2, 3.6.3 and 3.6.6 (only works with https://github.com/gfiehler/rabbithub/tree/3.6.3-Feature-Updates3, https://github.com/gfiehler/rabbithub/tree/3.6.6-Update and newer.)
Adds Admin page for managing RabbitHub Functionality.
Including
- Viewing tables of
- Subscriptions
- Consumers
- HTTP Post Error Summary
- Environment Variable Settings
- Download Subscribers in JSON file
- Upload Subscribers from a JSON file
- Actions
- Create a new Subscription
- Delete a Subscription
- Re-Subscribe (Activate) a Subscription
You can build and install it like any other plugin (see the plugin development guide).
This is dependent on the rabbitmq_management plugin being activated on the rabbitmq instance.
The download subscriptions for either all subscriptions or for individual subscriptions seems to only work with Firefox as Chrome does not ask for credentials. All other functions seem to work fine in Chrome.
You can drive the HTTP API yourself. It installs into the management plugin's API; you should understand that first. Once you do, the additional paths look like:
GET | PUT | DELETE | POST | Path | Description |
---|---|---|---|---|---|
X | X | /api/hub/subscriptions | A list of all subscribers To create a subscriber via a POST to this URL you will need a body like this: {"vhost":"myvhost","queue-or-exchange":"q or x","q-or-x-name":"queue name","callback-uri":"http://server:Port/subscriber/callback/url","topic":"hub.topic value","lease-seconds":"1000000000"} |
||
X | X | /api/hub/subscriptions/ vhost/resource_type/resource_name/ topic/callback |
Get a subscriber or Delete a subscriber | ||
X | /api/hub/subscriptions/ vhost/resource_type/resource_name/ topic/callback/lease_microseconds |
hub_mode = subscribe: Re-subscribe, this PUT api will re-subscribe this entry. hub_mode = unsubscribe: Deactivate, this PUT api will deactivate the subscription. This will shutdown all consumers and change status to inactive |
|||
X | /api/hub/consumers | Get a list of consumers | |||
X | /api/hub/errors | Get a list of http post to subscriber errors |
RabbitHub Management UI is a Rabbitmq_management UI plugin. RabbitHub is setup as an admin function. For a Rabbitmq user to use the RabbitHub Management Plugin, the user must have the administrator
tag (role).
For a Rabbitmq_management user to perform export/import the user must have both administrator,rabbithub_admin
tags (roles).
This page will show a list of subscribers, consumers, http post errors summary, form to add a new subscriber, environment variable settings, and ability to import/export subscribers in batch.
The name column for each subscriber is a non-unqiue name that is a combination of the resource_topic
and is a link to the details page for that subscriber. A truly unique name would also have to inlcude the callback URL, however that was too long to use in the UI. The name is a link to the details page for that Subscriber.
For details on what each field means for Adding a Subscriber, please see the RabbitHub readme file.
Environment Variables displayed in the configuration section can be found in the rabbitmq.config file. This file is commonly found in /etc/rabbitmq directory in Unix installations.
Import and Export of subscribers can be done via the UI by downloading or uploading JSON files in the following format. See RabbitHub batch processing for more details.
Note: This can be used as backup or to migrate subscribers between environments.
{
"subscriptions": [{
"vhost": "/",
"resource_type": "queue",
"resource_name": "ha.q2",
"topic": "inactivetest",
"callback": "http://callbackdomain/subscriber/s2",
"lease_expiry_time_microsec": 1472911582355564,
"lease_seconds": 1000000,
"ha_mode": "all",
"status": "inactive"
}, {
"vhost": "/",
"resource_type": "queue",
"resource_name": "ha.1",
"topic": "activetest",
"callback": "http://callbackdomain/subscriber/s1",
"lease_expiry_time_microsec": 1472911582355564,
"lease_seconds": 1000000,
"ha_mode": "all",
"status": "active"
}]
On this page you see a single subscriber and its information along with three possible operations
- Delete: this button will unsubscribe the entry. This will remove the subscription and stop all consumers
- Activate/Resubscribe: this button will subscribe the entry to reset if there is an issue.
- Deactivate: this button will unsubscribe or deactivate the entry. This will shutdown all consumers for this entry and change its status to inactive.
This page will also show the consumers and Post errors for this subscriber.