Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

A Hello World Plugin for getting started with plugin development for the HiveMQ MQTT broker

License

Notifications You must be signed in to change notification settings

hivemq/hivemq-hello-world-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HiveMQ Hello World Plugin

Note
HiveMQ 4 uses a new extension system. This HiveMQ 3 plugin is not compatible with HiveMQ 4. The new version can be found here.

Purpose

This Hello World plugin is a showcase for the kind of functionality that is possible within the HiveMQ plugin environment. There is a Maven Archetype available to generate a much more basic plugin from the IDE.

We strongly recommend to read the HiveMQ Plugin Documentation to grasp the core concepts of HiveMQ plugin development.

What you’ll get

This Hello World plugin implements a few simple HiveMQ Callbacks to get you started:

  • A callback when a client connects

  • A callback when a client disconnects

  • A callback when a client publishes something

  • A callback when HiveMQ starts

  • A scheduled callback that gets executed every 5 sec

There are also some advanced callbacks, which implement more complex use cases:

  • A callback that shows the async Subscription Service

  • A scheduled callback using the RetainedMessages Service

  • A callback that shows the Client Service and Publish Service

Also, this hello world plugin can reads configurations from a properties file (and reloads it every 5 minutes).

There’s a Maven profile configured which starts HiveMQ with your plugin. Just enable the profile and run the package Maven phase.

Important
Don’t forget to set the path to your HiveMQ installation in the pom.xml. There’s a "FIXME:" in the pom.xml to remind you of that.

The plugin is documented with javadoc which explains what’s going on. Please don’t forget to read the extensive HiveMQ Plugin Documentation.

Trying the plugin

  1. Execute the package goal from Maven with the profile RunWithHiveMQ activated. (Need help?: Consult: The maven documentation)

  2. Now HiveMQ should be running with your plugin installed.

  3. Connect with a MQTT client of your choice and publish something. You should see some log output.

Next steps

Awesome, you got your first HiveMQ plugin working. Now grab a coffee and prepare for the next steps:

  • Read about the available HiveMQ callbacks here.

  • Implement a great plugin. Bring your JDBC driver and do some database fun. Integrate with your favourite web service. There are no limits :-)

  • Blog about your awesome plugin. Tell us and if you like we can add your plugin to the plugin registry on http://www.hivemq.com

Need help?

If you encounter any problems, we are happy to help. The best place to get in contact is our support.

Contributing

If you want to contribute to HiveMQ Hello World Plugin, see the contribution guidelines.

License

HiveMQ Hello World Plugin is licensed under the APACHE LICENSE, VERSION 2.0. A copy of the license can be found here.

About

A Hello World Plugin for getting started with plugin development for the HiveMQ MQTT broker

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 9

Languages