Plugins
Many aspects of VerneMQ can be extended using plugins. The standard VerneMQ package comes with several official plugins. You can show the enabled & running plugins via:
1
vmq-admin plugin show
Copied!
The command above displays all the enabled plugins together with the hooks they implement:
1
+-----------+-----------+-----------------+-----------------------------+
2
| Plugin | Type | Hook(s) | M:F/A |
3
+-----------+-----------+-----------------+-----------------------------+
4
|vmq_passwd |application|auth_on_register |vmq_passwd:auth_on_register/5|
5
| vmq_acl |application| auth_on_publish | vmq_acl:auth_on_publish/6 |
6
| | |auth_on_subscribe| vmq_acl:auth_on_subscribe/3 |
7
+-----------+-----------+-----------------+-----------------------------+
Copied!

Enable a plugin

1
vmq-admin plugin enable --name=vmq_acl
Copied!
This enables the ACL plugin. Because the vmq_acl plugin is already started the above command won't succeed. In case the plugin sits in an external directory you must also to provide the --path=PathToPlugin.

Disable a plugin

1
vmq-admin plugin disable --name=vmq_acl
Copied!

Persisting plugins

To make a plugin start when VerneMQ starts they need to be configured in the main vernemq.conf file.
The general syntax to enable a plugin is to add a line like plugins.pluginname = on, using the vmq_passwd plugin as an example:
1
plugins.vmq_passwd = on
Copied!
And if the plugin is external the path can be specified like this:
1
plugins.myplugin = on
2
plugins.myplugin.path = /path/to/plugin
Copied!
Plugin specific settings can be configured via myplugin.somesetting = value, like:
1
vmq_passwd.password_file = ./etc/vmq.passwd
Copied!
See the vernemq.conf file for details.
Last modified 3yr ago