Bolstering the HiveMQ Enterprise Bridge Extension's Message Throughput
While the HiveMQ Enterprise Bridge Extension supports high message rates and complicated topic schemas, it can be important to identify configuration options which can improve client load balancing and message throughput rates for connections where high message rates are required.
Below, we will provide some configuration suggestions to increase available throughput of your extension.
Step 1 : Verify Configuration Options
Some configuration options, such as the MQTT flow control options below, which are available for Bridge connections can directly limit the maximum number of sent messages pending acknowledgement and publish rates. Be sure these are configured to values that make sense for your environment, and intended usage.
<mqtt>
<version>5</version>
<flow-control>
<send-maximum>100</send-maximum>
<outbound-publish-rate-limit>100</outbound-publish-rate-limit>
</flow-control>
</mqtt>Step 2: Consider Multiple Bridge Connections
Creating multiple separate bridge connections can multiply throughput capacity. Each bridge client connection has its own flow control limits, and can reduce limitations on latency for message acknowledgement before delivery of the next valid messages.
To configure multiple bridges, add additional bridge configurations:
<hivemq-bridge-extension>
<bridges>
<bridge>
<name>bridge-connection-1</name>
<remote-broker>
<!-- Configuration for first bridge -->
</remote-broker>
<topics>
<topic>
<filter>topic/filter/1</filter>
</topic>
</topics>
</bridge>
<bridge>
<name>bridge-connection-2</name>
<remote-broker>
<!-- Configuration for second bridge -->
</remote-broker>
<topics>
<topic>
<filter>topic/filter/2</filter>
</topic>
</topics>
</bridge>
</bridges>
</hivemq-bridge-extension>
Step 3: Optimize Session Settings
Ensuring that client options, such as clean-start, are set as expected to allow for queueing if the bridge is unable to establish a connection, or to allow for keep-alive times that match your network configuration.
<mqtt>
<clean-start>false</clean-start>
<session-expiry>3600</session-expiry>
<keep-alive>60</keep-alive>
</mqtt>Step 4: Monitor Bridge Metrics
Monitor extension-specific metrics to track bridge performance:
Bridge throughput metrics
com.hivemq.bridge-extension.total.publish.countcom.hivemq.bridge-extension.total.publish-failed.countcom.hivemq.bridge-extension.[bridge-name].publish.duration
Connection Status
com.hivemq.bridge-extension.total.connect.count,com.hivemq.bridge-extension.total.disconnect.count,com.hivemq.bridge-extension.total.connect-failed.count