Data Hub On Edge

Data Hub is available on HiveMQ Edge and offers the same functionality as for the HiveMQ Enterprise broker. For detailed information, see our Data Hub Quick Start Guide.

Data Hub is a commercial feature and requires a license. Please reach out to our sales team to obtain one.

Data Hub Configuration on HiveMQ Edge

When a valid license is present, Data Hub is fully enabled by default and requires no further configuration.
Individual components of Data Hub can be selectively disabled by explicitly setting the enabled attribute to false in the following way:

Example Data Hub on HiveMQ Edge configuration
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hivemq>
    <modules>
       <data-hub>
           <data-validation>
               <enabled>true</enabled>
           </data-validation>
           <behavior-validation>
                <enabled>false</enabled>
           </behavior-validation>
           <scripting>
                <enabled>true</enabled>
           </scripting>
       </data-hub>
    </modules>
</hivemq>

The example configuration disables behavior validation while it keeps data validation and scripting enabled.

Data Hub stores its scripts, schemas, and policies with the persistence mode of HiveMQ Edge. For more information on persistence, see Offline Buffering.

Data Hub persistence

By default, Data Hub uses in-memory persistence, which means that all stored data is lost when HiveMQ Edge restarts. To preserve data across restarts, you must configure file-native persistence.

When a Data Hub preset is configured, the preset file is the source of truth. The persistence mode does not apply to the Data Hub model. Scripts, schemas, and policies created through the REST API or the UI are lost when HiveMQ Edge restarts.
Example: Enable persistence for Data Hub on HiveMQ Edge
<?xml version="1.0"?>
<hivemq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <persistence>
        <mode>file-native</mode>
    </persistence>
</hivemq>

Script Engine Pool

Data Hub executes transformation scripts on a pool of JavaScript engines. The pool size is set with the internal options data-hub.script-runtime.min-engine-count and data-hub.script-runtime.max-engine-count in the config.xml file. By default, the minimum is half the number of CPUs available to HiveMQ Edge. The maximum is the number of CPUs. Both values are at least 1.

Example configuration of the script engine pool
<hivemq>
    ...
    <internal>
        <option>
            <key>data-hub.script-runtime.min-engine-count</key>
            <value>2</value>
        </option>
        <option>
            <key>data-hub.script-runtime.max-engine-count</key>
            <value>4</value>
        </option>
    </internal>
</hivemq>

HiveMQ Edge accepts every <option> under <internal> without validating the key. A misspelled key has no effect and is not reported. Check the key names in your configuration against the ones above.

Data Hub in the HiveMQ Edge REST API

The Data Hub portions of the HiveMQ REST API and the HiveMQ Edge REST API are identical. All available API interactions work the same way.

However, access to the HiveMQ Edge REST API requires JWT authorization. For more information on JWTs in HiveMQ Edge, see HiveMQ Edge API . An example to obtain a token is shown using cURL.