summaryrefslogtreecommitdiff
path: root/deps/rabbitmq_shovel_management/README.md
blob: 8e2bcfc8a433712e745bd1ed1b056d019d352431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# 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

This plugin ships with RabbitMQ. Like all [plugins](https://www.rabbitmq.com/plugins.html), it must be enabled
before it can be used:

```
rabbitmq-plugins enable rabbitmq_shovel_management
```


## Usage

When the plugin is enabled, there will be a Shovel management
link under the Admin tab.

### HTTP API

The HTTP API adds endpoints for listing, creating, and deleting shovels.

#### `GET /api/shovels[/{vhost}]`
Lists all shovels, optionally filtering by Virtual Host.

**Example**

```bash
curl -u guest:guest -v http://localhost:15672/api/shovels/%2f
```

#### `PUT /api/parameters/shovel/{vhost}/{name}`
Creates a shovel, passing in the configuration as JSON in the request body.

**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
curl -u guest:guest -v -X PUT -H 'Content-Type: application/json' -d @./shovel.json \
  http://localhost:15672/api/parameters/shovel/%2F/my-shovel
```
*Note* Either `dest_queue` OR `dest_exchange` can be specified in the `value` stanza of the JSON, but not both.

#### `GET /api/parameters/shovel/{vhost}/{name}`
Shows the configurtion parameters for a shovel.

**Example** 

```bash
curl -u guest:guest -v http://localhost:15672/api/parameters/shovel/%2F/my-shovel
```

#### `DELETE /api/parameters/shovel/{vhost}/{name}`

Deletes a shovel.

**Example** 

```bash
curl -u guest:guest -v -X DELETE http://localhost:15672/api/parameters/shovel/%2F/my-shovel
```

## License and Copyright

Released under [the same license as RabbitMQ](https://www.rabbitmq.com/mpl.html).

2007-2018 (c) 2007-2020 VMware, Inc. or its affiliates.