Today, plugins are the main extending point of the software systems. As we know from other software projects, plugins are used to extend the capability or add any other skills to the software system.
RabbitMQ has its own plugin system, and it gives us default plugins as well. Moreover, RabbitMQ gives us one more opportunity: developing our custom plugin using RabbitMQ's API.
In this chapter, we will discuss the details of the plugins, default plugins and custom plugin development, as the following list describes:
RabbitMQ provides a number of tools that aid us in plugin management. Additionally, RabbitMQ provides lots of default plugins to monitor, manage, add features, and so on to RabbitMQ. Plugins are crucial because they introduce an important set of new features, making RabbitMQ easier to use and manage.
Now, we are ready to talk about enabling and disabling plugins.
RabbitMQ provides a plugin management tool called rabbitmq-plugins. rabbitmq-plugins is a command line tool to enable, disable, and list the plugins within the RabbitMQ server. The rabbitmq-plugins
command will enable or disable plugins by updating the plugin configuration file. It will then contact the running server to tell it to start or stop plugins as needed. You can use the -n
option to specify a different node, or use --offline
to only change the file.
As all management tools of RabbitMQ need write permissions, rabbitmq-plugins also needs write permissions to get allowed to be run by the user. General usage of the tool is as follows:
rabbitmq-plugins {command} [command param1, command param2,…]
The functions and the parameters of rabbitmq-plugins are listed in the following table:
Table 1: rabbitmq-plugins
commands and its parameters
The following screenshot of command line shows how to run listing command of rabbitmq-plugins:
In addition, the following screenshot of command line shows how to enable or disable any plugin using the command of enable or disable of rabbitmq-plugins:
RabbitMQ gives us another opportunity to develop our own plugins using Erlang language. Moreover, lots of plugins developed by individual developers can be found on the Internet.
Now, it is time to show you how to install a plugin from source code to be enabled on the RabbitMQ Server.
Firstly, we will choose one of the open source plugins called RabbitMQ Random Exchange Type plugin, which can be fetched from git://github.com/jbrisbin/random-exchange.git via Git source code management tool using the following command:
git clone git://github.com/jbrisbin/random-exchange.git cd random-exchange make package cp dist/*.ez $RABBITMQ_HOME/plugins
Then, we go to the created folder called random-exchange
. After that, we build the source code and copy the built files to $RABBITMQ_HOME/plugins
using the following commands:
make package cp dist/*.ez $RABBITMQ_HOME/plugins
Now, we are ready to enable our third party plugin using the following command with the help of rabbitmq-plugins tool:
rabbitmq-plugins enable random-exchange
RabbitMQ contributors publish the default plugins that will be helpful to add new protocols, some authentication functionality on RabbitMQ Server, and so on. Moreover, some experimental plugins published by the contributors are also a part of these publications.
To talk in detail regarding the plugins, let's move on to the following table that shows the default plugins and their description:
Plugin Name |
Plugin Description |
---|---|
|
To use external LDAP as authentication or authorization functionality. This plugin will be explained in detail in Chapter 8, Security in RabbitMQ. |
|
To add authentication mechanism using SSL certificates. This plugin will be explained in detail in Chapter 8, Security in RabbitMQ. |
|
To provide the consistent hashing on the exchanges to ensure that all queues bound to exchange will receive an equal number of messages. |
|
To transmit messages between brokers without clustering within wide area networks. Provides scalability skills. This plugin was explained in detail in Chapter 3, Architecture and Messaging. |
|
To manage the federation plugin in RabbitMQ Server with provided API and UI. Federation Management plugin is active when the RabbitMQ Management plugin is also active. |
|
To monitor and manage RabbitMQ using web based applications. Applications use RabbitMQ API, one of the most useful plugins in RabbitMQ. |
|
To monitor and manage the clusters of the RabbitMQ needs. |
|
Enables the supporting of MQTT 3.1 protocol in RabbitMQ. MQTT is simply defined as lightweight publish/subscribe messaging transport. |
|
Enables the ability to continually consume messages from one queue and publish them to exchanges in another broker. This plugin's functionality was explained in Chapter 3, Architecture and Messaging. |
|
To monitor and manage the shovel in RabbitMQ Server with provided UI and API. Shovel Management plugin is active when the RabbitMQ Management plugin is active. |
|
Enables the gateway to expose the AMQP functionality using the STOMP protocol that provides an interoperable wire format. |
As discussed earlier, contributors publish some experimental plugins; for instance, supporting the AMQP version 1.0 plugin. The following table shows the details of the experimental plugins and their description:
Plugin Name |
Plugin Description | |
---|---|---|
|
Enables the AMQP version 1.0 RabbitMQ Server. | |
|
Enables the AMQP over HTTP protocol using | |
|
To provide the examples of AMQP over HTTP, such as shared whiteboard, chat application, and some tests. | |
|
Visualizes the broker topology using the management web application by adding the Visualizer tab. | |
|
Enables message tracing and logging. | |
|
To attach rabbitmq_stomp to web browsers using the HTML 5 WebSockets layer SockJS. | |
|
To provide the |