HiveMQ Data Hub

The HiveMQ Data Hub provides mechanisms to define how MQTT data and MQTT client behavior are handled in the HiveMQ broker.

  • Data Validation in the HiveMQ Data Hub allows you to implement declarative policies that check whether your data sources are sending data in the data format you expect.
    This process ensures that the value of the data is assessed at an early stage in the data supply chain.
    To eliminate the need for subscribing clients to perform resource-intensive validation, checks occur before your data reaches downstream devices or upstream services.

  • Behavior Validation gives you the ability to model the behavior of your MQTT clients throughout the entire lifecycle of the client.
    This added capability offers a complete overview of client behavior at every state and enhanced control over how clients work with your MQTT broker.
    HiveMQ Data Hub behavior policies instantiate behavior models that can be acted upon as needed to meet your business needs.

Currently, HiveMQ Data Hub includes three predefined behavior models that you can use in your behavior policies. For more information, see Behavior Models.

The HiveMQ Platform bundle includes a free version of the HiveMQ Data Hub with basic functionality.
Additionally, you can start a five-hour trial mode of the Data Hub to try out the full range of Data Hub capabilities.
To learn more about the different ways you can explore the HiveMQ Data Hub, see HiveMQ Data Hub Licensing.

Features of HiveMQ Data Hub

Our validation functionality lets your development teams use the HiveMQ broker to automatically enforce data validation and behavior validation strategies of their own design (including fine-tuned control over how the broker handles incoming valid and invalid MQTT messages).

Example Data Validation Workflow
Figure 1. Example Data Validation Workflow

In this user journey, an engineering team develops a microservice that consumes sensor data on specific MQTT topics. To ensure the reliability of the microservice, the engineers upload a JSON Schema to the HiveMQ Data Hub that outlines the data structure they want to receive.

Example geographical location JSON Schema
{
  "$id": "https://example.com/geographical-location.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Longitude and Latitude Values",
  "description": "A geographical coordinate.",
  "required": [
    "latitude",
    "longitude"
  ],
  "type": "object",
  "properties": {
    "latitude": {
      "type": "number",
      "minimum": -90,
      "maximum": 90
    },
    "longitude": {
      "type": "number",
      "minimum": -180,
      "maximum": 180
    }
  }
}

To enforce the rules and structure that the schema outlines, the operations team registers an appropriate policy that tells HiveMQ how to handle incoming MQTT messages.

Example policy definition
{
  "id": "com.hivemq.policy.coordinates",
  "matching": {
    "topicFilter": "coordinates"
  },
  "validation": {
    "validators": [
      {
        "type": "schema",
        "arguments": {
          "strategy": "ALL_OF",
          "schemas": [
            {
              "schemaId": "gps_coordinates",
              "version": "latest"
            }
          ]
        }
      }
    ]
  },
  "onFailure": {
    "pipeline": [
      {
        "id": "logFailure",
        "functionId": "log",
        "arguments": {
          "level": "WARN",
          "message": "${clientId} sent invalid coordinates on topic '${topic}' with result '${validationResult}'"
        }
      }
    ]
  }
}

In the example, the policy ensures that the HiveMQ broker drops MQTT messages published to the MQTT topic coordinates that do not match the desired gps_coordinates schema. In addition, HiveMQ prints a log statement to help debug the misbehaving clients.

The result is a more efficient microservice that only processes MQTT messaging data that adheres to the specified format. This type of well-defined data validation can save time and resources:

  • Enables parallel development

  • Reduces the number of issues that reach production systems

  • Simplifies the identification of invalid data sources

HiveMQ Data Hub Licensing

The HiveMQ Data Hub offers various license tiers to cater to different needs.
For detailed information or to discuss which option is the best for your individual use case, contact our sales team.

Since HiveMQ 4.17, a free version of the HiveMQ Data Hub is included in the HiveMQ Platform bundle.
Free mode enables you to create a single policy and use a limited set of functionality.

To explore the complete capabilities of the HiveMQ Data Hub, you can activate a 5-hour trial mode at no additional cost. For more information, see Activate HiveMQ Data Hub Trial Mode.

Activate Data Hub Trial Mode

The 5-hour Data Hub trial mode lets you explore the complete capabilities of HiveMQ Data Hub at no additional cost.

In trial mode, you can try out all available functionality and create an unlimited number or schemas and policies. To utilize features after your trial period ends, you can continue using the free mode or obtain a valid license based on your requirements.
For more information, contact our sales team.

Before you activate your trial mode, make sure the <enabled> tags for the <data-hub> and the <rest-api> are set to true in the config.xml file of your HiveMQ instance. For more information, see Configuration.
  • Send a POST-request with an empty body to the endpoint:
    <host>:<port>/api/v1/management/data-hub/start-trial
    with the default values for the REST API listener:
    localhost:8888/api/v1/management/data-hub/start-trial

  • The status code 204 is returned upon successful activation.

The trial mode gives you full access to all HiveMQ Data Hub functionality for a duration of 5 hours.
When your trial period ends, the Data Hub reverts to the Free mode or the installed license, depending on your configuration.

Existing policies that exceed the limitations of the mode you return to after your trial remain in place. However, it is not possible to add new policies that exceed the limits of the active mode that is currently active.
The Data Hub trial mode is not available in HiveMQ Edge.

Get Started

The best way to set up and learn more about the HiveMQ Data Hub is to follow our Quick Start Guide.