2016-07-10 05:31:09 +08:00
|
|
|
# RabbitMQ Shovel Management Plugin
|
|
|
|
|
|
|
|
|
|
Adds information on shovel status to the management plugin. Build it
|
|
|
|
|
like any other plugin.
|
|
|
|
|
|
|
|
|
|
If you have a heterogenous cluster (where the nodes have different
|
|
|
|
|
plugins installed), this should be installed on the same nodes as the
|
|
|
|
|
management plugin.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Installing
|
|
|
|
|
|
2019-03-20 16:23:30 +08:00
|
|
|
This plugin ships with RabbitMQ. Like all [plugins](https://www.rabbitmq.com/plugins.html), it must be enabled
|
2018-12-04 04:51:53 +08:00
|
|
|
before it can be used:
|
2016-07-10 05:31:09 +08:00
|
|
|
|
|
|
|
|
```
|
2018-12-04 04:51:53 +08:00
|
|
|
rabbitmq-plugins enable rabbitmq_shovel_management
|
2016-07-10 05:31:09 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
2018-12-04 04:51:53 +08:00
|
|
|
When the plugin is enabled, there will be a Shovel management
|
2016-07-10 05:31:09 +08:00
|
|
|
link under the Admin tab.
|
|
|
|
|
|
2018-01-26 03:49:18 +08:00
|
|
|
### HTTP API
|
2016-07-10 05:31:09 +08:00
|
|
|
|
2018-01-26 03:49:18 +08:00
|
|
|
The HTTP API adds endpoints for listing, creating, and deleting shovels.
|
2016-07-10 05:31:09 +08:00
|
|
|
|
2018-12-04 04:51:53 +08:00
|
|
|
#### `GET /api/shovels[/{vhost}]`
|
2018-01-26 03:49:18 +08:00
|
|
|
Lists all shovels, optionally filtering by Virtual Host.
|
|
|
|
|
|
|
|
|
|
**Example**
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -u guest:guest -v http://localhost:15672/api/shovels/%2f
|
|
|
|
|
```
|
|
|
|
|
|
2018-12-04 04:51:53 +08:00
|
|
|
#### `PUT /api/parameters/shovel/{vhost}/{name}`
|
|
|
|
|
Creates a shovel, passing in the configuration as JSON in the request body.
|
2018-01-26 03:49:18 +08:00
|
|
|
|
|
|
|
|
**Example**
|
|
|
|
|
|
|
|
|
|
Create a file called ``shovel.json`` similar to the following, replacing the parameter values as desired:
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"component": "shovel",
|
|
|
|
|
"name": "my-shovel",
|
|
|
|
|
"value": {
|
|
|
|
|
"ack-mode": "on-publish",
|
|
|
|
|
"add-forward-headers": false,
|
|
|
|
|
"delete-after": "never",
|
|
|
|
|
"dest-exchange": null,
|
|
|
|
|
"dest-queue": "dest",
|
|
|
|
|
"dest-uri": "amqp://",
|
|
|
|
|
"prefetch-count": 250,
|
|
|
|
|
"reconnect-delay": 30,
|
|
|
|
|
"src-queue": "source",
|
|
|
|
|
"src-uri": "amqp://"
|
|
|
|
|
},
|
|
|
|
|
"vhost": "/"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Once created, post the file to the HTTP API:
|
|
|
|
|
|
|
|
|
|
```bash
|
2018-11-01 02:41:40 +08:00
|
|
|
curl -u guest:guest -v -X PUT -H 'Content-Type: application/json' -d @./shovel.json \
|
2018-01-26 03:49:18 +08:00
|
|
|
http://localhost:15672/api/parameters/shovel/%2F/my-shovel
|
|
|
|
|
```
|
2018-12-04 04:51:53 +08:00
|
|
|
*Note* Either `dest_queue` OR `dest_exchange` can be specified in the `value` stanza of the JSON, but not both.
|
2018-01-26 03:49:18 +08:00
|
|
|
|
2018-12-04 04:51:53 +08:00
|
|
|
#### `GET /api/parameters/shovel/{vhost}/{name}`
|
2018-01-26 03:49:18 +08:00
|
|
|
Shows the configurtion parameters for a shovel.
|
|
|
|
|
|
2024-02-06 01:26:25 +08:00
|
|
|
**Example**
|
2018-01-26 03:49:18 +08:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -u guest:guest -v http://localhost:15672/api/parameters/shovel/%2F/my-shovel
|
|
|
|
|
```
|
|
|
|
|
|
2018-12-04 04:51:53 +08:00
|
|
|
#### `DELETE /api/parameters/shovel/{vhost}/{name}`
|
|
|
|
|
|
|
|
|
|
Deletes a shovel.
|
2018-01-26 03:49:18 +08:00
|
|
|
|
2024-02-06 01:26:25 +08:00
|
|
|
**Example**
|
2018-01-26 03:49:18 +08:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -u guest:guest -v -X DELETE http://localhost:15672/api/parameters/shovel/%2F/my-shovel
|
|
|
|
|
```
|
2016-07-10 05:31:09 +08:00
|
|
|
|
|
|
|
|
## License and Copyright
|
|
|
|
|
|
|
|
|
|
Released under [the same license as RabbitMQ](https://www.rabbitmq.com/mpl.html).
|
|
|
|
|
|
2024-02-06 01:26:25 +08:00
|
|
|
2007-2018 (c) 2007-2024 Broadcom. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
|