MQTT broker

Connect an MQTT broker

The following parameters are available to connect an MQTT broker:

Parameter

Description

Example value

name

*

The name of the destination

My Server

description

Description of the destination

Endpoint of my server

host

*

The host name of the MQTT broker

broker.hivemq.com

port

*

The port on which the MQTT broker allows encrypted connections

8883

username

*†

The username for KPN Things to connect to the broker

your-username

password

*†

The password for KPN Things to connect to the broker

your-password

applicationId

*

MQTT Client ID for KPN Things to connect to the broker

kpnthings

topic

*

The topic structure describing how KPN Things should publish data. There are several variables available

things/%p/%d/%n

qosLevel

*

The MQTT Quality of Service desired for the connection to your broker.

Options:

  • AT_MOST_ONCE

  • AT_LEAST_ONCE

  • EXACTLY_ONCE

AT_LEAST_ONCE

messageTimeout

*

Timeout for sending a message and handling QoS in milliseconds

10000

retainMessage

*

Whether messages send to the broker should be retained messages.

false

*) required value †) secret value, can only be written

Variables

Value
Replaced with

%a

MQTT Client ID (applicationId)

%n

SenML base name from the decoded payload

%c

Client UUID

%d

Device UUID

%p

Destination UUID

%m

Message request ID

%b

Device Barcode

What does the connection do?

  • Open an encrypted client connection to your MQTT broker.

  • Publish all forwarded IoT data in SenML JSON format on topics following the specified topic template.

Trusted TLS/SSL certificates

We do not support self-signed certificates. Your TLS/SSL certificate should be signed by a root certificate authority (CA) that is trusted by the default Java trust store. You can use the SSL Server Test from Qualys to check if your certificate is trusted by the Java trust store:

he result of the SSL Server Test indicating the certificate is trusted by Java

Your server should preferably use TLSv1.2 or higher, but at least TLSv1.1. Older protocols are not supported because they are not considered safe.

Learn about MQTT

Are you new to MQTT, but still interested in using it? HiveMQ has published some very nice articles about MQTT essentials:

Test with a demo broker

For testing purposes, you can use the public MQTT broker available at https://broker.hivemq.com. When connecting to this broker, make sure to use port 8883. Although the broker supports anonymous access, you may enter any username and password in Things to establish the connection.

Keep in mind that this is an open, publicly accessible MQTT broker. It is not suitable for production use.

Last updated

Was this helpful?