Skip to content

Commit 3f4cd4d

Browse files
Merge pull request #2273 from rabbitmq/lukebakken/update-plugin-dev-guide
Update plugin development guide
2 parents 9f5f5a7 + 103387d commit 3f4cd4d

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/pages/plugin-development.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ provide the basics of how your would build your very own RabbitMQ plugin.
136136

137137
The following example details how you might build a simple plugin that acts like a metronome.
138138

139-
Every second, it fires a message that has a routing key in the form `yyyy.MM.dd.dow.hh.mm.ss` to a topic exchange called "metronome" by default.
140-
Applications can attach queues to this exchange with various routing keys in order to be invoked at regular intervals.
141-
For example, to receive a message every second, a binding of "*.*.*.*.*.*.*" could be applied. To receive
142-
a message every minute, a binding of "*.*.*.*.*.*.00" could be applied instead.
139+
Every second, it fires a message that has a routing key in the form `yyyy.MM.dd.dow.hh.mm.ss` to a
140+
topic exchange called `metronome` by default. Applications can attach queues to this exchange with
141+
various routing keys in order to be invoked at regular intervals. For example, to receive a message
142+
every second, a binding of `*.*.*.*.*.*.*` could be applied. To receive a message every minute, a
143+
binding of `*.*.*.*.*.*.00` could be applied instead.
143144

144145
The [rabbitmq-metronome](https://github.com/rabbitmq/rabbitmq-metronome) repository on GitHub
145146
contains a copy of the code for this plugin.
@@ -246,16 +247,24 @@ The following table should explain the purpose of the various files in the repos
246247

247248
## Development Process
248249

250+
Clone your plugin into the `deps` directory of your `rabbitmq-server` repository:
251+
252+
```bash
253+
git clone https://github.com/rabbitmq/rabbitmq-server.git
254+
cd rabbitmq-server
255+
git clone https://github.com/user/my-rabbitmq-plugin.git deps/my_rabbitmq_plugin
256+
```
257+
249258
Run make to build the plugin:
250259

251260
```bash
252-
make
261+
make -C deps/my_rabbitmq_plugin
253262
```
254263

255-
To start a node with the plugin built and enabled on:
264+
To start a node with your `my_rabbitmq_plugin` and the management plugin enabled:
256265

257266
```bash
258-
make run-broker
267+
make RABBITMQ_ENABLED_PLUGINS='rabbitmq_management my_rabbitmq_plugin' run-broker
259268
```
260269

261270
To ensure that the new plugin is up and running, run the following command:
@@ -274,18 +283,19 @@ If your plugin has loaded successfully, you should see it in the enabled plugin
274283
# =>
275284
# => * rabbitmq_metronome
276285
# => * amqp_client
286+
# => * my_rabbitmq_plugin
277287
```
278288

279289
To run Common Test test suites, use
280290

281291
```bash
282-
make tests
292+
make -C deps/my_rabbitmq_plugin tests
283293
```
284294

285295
Finally, you can produce an <code>.ez</code> file, suitable for distribution with:
286296

287297
```bash
288-
DIST_AS_EZS=yes make dist
298+
make -C deps/my_rabbitmq_plugin DIST_AS_EZS=yes dist
289299
```
290300

291301
The file appears in the <tt>plugins</tt> directory under repository root.

0 commit comments

Comments
 (0)