Skip to content
Stand with Ukraine flag

HTTP integration

TBMQ HTTP Integration forwards MQTT messages from devices to an external system using the HTTP protocol. It acts as a bridge between TBMQ and external applications, ensuring reliable data exchange.

  1. Device (client) publishes an MQTT message to a topic matching the integration’s topic filters.
  2. TBMQ broker receives the message and forwards it to the TBMQ Integration Executor.
  3. Integration Executor processes the message, formats it as an HTTP request, and forwards it to the external service.
  4. External service receives the request and processes the data.

In this tutorial, ThingsBoard is used as the external HTTP service. Any other HTTP-compatible service can be used instead.

Follow the ThingsBoard HTTP Integration Guide to create an integration on ThingsBoard Cloud.

Once created:

  1. Open the details page and enable debug mode to verify data reception.
  2. Copy the HTTP endpoint URL — you will need it in the next step.
  1. Go to the Integrations page and click the ”+” button.
  2. Select HTTP as the integration type and click Next.
  3. On the Topic Filters step, click Next to subscribe to the default topic tbmq/#.
  4. In the Configuration step, paste the Endpoint URL from the ThingsBoard Integration.
  5. Open Advanced settings and set Payload content type to JSON.
  6. Click Add to save the integration.

Topic filters define MQTT-based subscriptions that trigger the integration. When TBMQ receives a message matching a configured topic filter, the integration processes it and forwards the data to the external system.

For example, with the topic filter tbmq/devices/+/status, any of the following messages will trigger the integration:

tbmq/devices/device-01/status
tbmq/devices/gateway-01/status
FieldDescription
Send only message payloadIf enabled, the incoming message’s payload is forwarded as is. If disabled, a JSON object with the payload and additional properties is sent.
Endpoint URLThe external service URL where HTTP requests are sent.
Request MethodSupported: GET, POST, PUT, DELETE.
CredentialsAnonymous, Basic Authentication (username + password), or PEM-based authentication.
HeadersKey-value pairs added to the HTTP request headers.
Payload Content TypeFormat of the request body: JSON, Text, Binary (Base64).
Send as binary on parsing errorIf enabled, messages failing JSON or Text parsing are sent as binary. If disabled, they are not sent.
Read TimeoutMaximum time to wait for a response before timing out.
Max Parallel RequestsLimits the number of concurrent HTTP requests.
Max Response SizeMaximum allowed size for incoming responses.
MetadataCustom metadata attached to forwarded messages.

TBMQ logs integration-related events for debugging and troubleshooting:

  • Lifecycle Events — logs events such as Started, Created, Updated, Stopped.
  • Statistics — insights into integration performance, including processed message counts and error rates.
  • Errors — captures failures related to authentication, timeouts, payload formatting, or connectivity issues.
  1. Navigate to the WebSocket Client page.
  2. Select WebSocket Default Connection (or any working connection) and click Connect. Verify the connection status shows Connected.
  3. Set the Topic field to tbmq/http-integration to match the integration’s topic filter tbmq/#.
  4. Click the Send icon to publish the message.

If successful, open ThingsBoard Cloud → HTTP Integration details → Events tab. You should see an event with status OK and a payload similar to:

{
"payload": {
"temperature": 25
},
"topicName": "tbmq/http-integration",
"clientId": "tbmq_7QUvZzow",
"eventType": "PUBLISH_MSG",
"qos": 1,
"retain": false,
"tbmqIeNode": "tbmq_ie_node",
"tbmqNode": "tbmq_node",
"ts": 1742553324248,
"props": {},
"metadata": {
"integrationName": "HTTP integration"
}
}

Message field descriptions:

FieldDescription
payloadContent of the MQTT message.
topicNameMQTT topic to which the message was published.
clientIdID of the MQTT client that published the message.
eventTypeType of MQTT event. PUBLISH_MSG is the only supported type.
qosQuality of Service level of the incoming message.
retainWhether the message has the Retain flag set.
tbmqIeNodeNode ID of the Integration Executor that handled the message.
tbmqNodeNode ID of the TBMQ broker that received the message.
tsTimestamp (milliseconds) when the message was received.
propsMQTT 5.0 user properties or other MQTT properties.
metadataAdditional metadata from integration configuration (e.g., integration name).