Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hivemq/hivemq-google-cloud-pubsub-hello-world-customization

An example customization project for the HiveMQ Enterprise Extension for Google Cloud Pub/Sub using the HiveMQ Google Cloud Pub/Sub Extension Customization SDK.
https://github.com/hivemq/hivemq-google-cloud-pubsub-hello-world-customization

customization demonstration google-cloud google-cloud-pubsub google-cloud-pubsub-extension hello-world hivemq mqtt

Last synced: 2 months ago
JSON representation

An example customization project for the HiveMQ Enterprise Extension for Google Cloud Pub/Sub using the HiveMQ Google Cloud Pub/Sub Extension Customization SDK.

Awesome Lists containing this project

README

        

:hivemq-link: https://www.hivemq.com
:hivemq-google-cloud-pubsub-docs: {hivemq-link}/docs/google-cloud-pubsub/latest/enterprise-extension-for-google-cloud-pubsub/google-cloud-pubsub.html
:hivemq-google-cloud-pubsub-customization-docs: {hivemq-link}/docs/google-cloud-pubsub/latest/enterprise-extension-for-google-cloud-pubsub/google-cloud-pubsub-customization.html
:hivemq-blog-tools: {hivemq-link}/mqtt-toolbox/
:hivemq-support: https://community.hivemq.com

= HiveMQ Google Cloud Pub/Sub Extension Hello World Customization

image:https://img.shields.io/badge/Customization_Type-Demonstration-orange?style=for-the-badge[Extension Type]
image:https://img.shields.io/github/v/release/hivemq/hivemq-google-cloud-pubsub-hello-world-customization?style=for-the-badge[GitHub release (latest by date),link=https://github.com/hivemq/hivemq-google-cloud-pubsub-hello-world-customization/releases/latest]
image:https://img.shields.io/github/license/hivemq/hivemq-google-cloud-pubsub-hello-world-customization?style=for-the-badge&color=brightgreen[GitHub,link=LICENSE]

== Purpose

This Hello World customization uses two transformers.

- One `mqtt-to-pubsub` transformer that forwards MQTT publish messages to Google Cloud Pub/Sub.
This transformer reads the Google Cloud Pub/Sub topic from the custom settings of the `config.xml` file and preserves the MQTT topic,
retained flag, QoS level, and user properties as Pub/Sub message attributes.
- One `pubsub-to-mqtt` transformer that forwards Pub/Sub messages to HiveMQ.
This transformer reads the QoS level from the custom settings of the `config.xml` file, uses the `mqtt/topic` as the MQTT topic, and preserves
every Pub/Sub attribute as MQTT user properties.

== Installation

. Clone this repository into a Java 11 Gradle project.
. Run the `./gradlew jar` task from Gradle to build the customization.
. Move the `build/libs/hivemq-google-cloud-pubsub-hello-world-customization-4.34.0.jar` file to the `HIVEMQ_HOME/extensions/hivemq-google-cloud-pubsub-extension/customizations` directory.
. Copy the `src/main/resources/google-cloud-pubsub-configuration.xml` file to the `HIVEMQ_HOME/extensions/hivemq-google-cloud-pubsub-extension` folder.
. Adapt the configuration to your environment.
- Set the `` in the `` tag to match your Google Cloud Pub/Sub project ID.
- Set the `` in the `` tag to the absolute or relative path of your `service-account-key.json` file.
- Set the `` name in the `` tag to match the correct Google Cloud Pub/Sub subscription.
- Set the `` of the destination `` in the `` to the correct Google Cloud Pub/Sub topic.
. Delete the `HIVEMQ_HOME/extensions/hivemq-google-cloud-pubsub-extension/DISABLED` file (if there is one).
. Start HiveMQ.

== First Steps

=== Manually Test Your MQTT-to-Pub/Sub Mapping

- Connect with an {hivemq-blog-tools}[MQTT client] of your choice.
- Publish an MQTT message to the topic `topic/test`.
- Monitor the topic you configured in your Google Cloud Pub/Sub project for a received message. (Hint: Pub/Sub topics must have subscriptions or a message retention duration set for messages to be stored)

=== Manually Test Your Pub/Sub-to-MQTT Mapping

- Connect with an {hivemq-blog-tools}[MQTT client] of your choice.
- Subscribe to the topic `mqtt/topic`.
- Publish a Pub/Sub message to the Pub/Sub topic.
- Verify that you receive an MQTT message with your client.

== Need Help?

If you encounter any problems, we are happy to help.
The best place to get in contact is our {hivemq-support}[community forum].

== License

HiveMQ Google Cloud Pub/Sub Extension Hello World Customization is licensed under the `APACHE LICENSE, VERSION 2.0`.
A copy of the license can be found link:LICENSE[here].