Know its limits
When a publish is acknowledged, what a crash or a power cut can lose, and the measured throughput. See Guarantees and limits.
We use cookies
We use cookies for site analytics, to remember the campaign or partner link you arrived from and, if you allow it, to load the site search from Google. Nothing optional is set until you choose. You can change your choice anytime in Your Privacy Choices at the bottom of every page. Cookie Policy
This guide takes a new broker from one Docker command to messages flowing: through the web UI, from the command line, and to a client that was offline when they were sent. You need Docker on Linux, or Docker Desktop on macOS or Windows; see Supported hosts.
Run the container.
docker run -d --name tbmq-lite --restart unless-stopped \ -p 1883:1883 -p 8083:8083 -p 8084:8084 \ -v tbmq-lite:/data thingsboard/tbmq-lite:2.5.0-betaWait until it is healthy.
Run docker ps. The broker is ready when the tbmq-lite container shows healthy.
Sign in.
Open http://localhost:8083 and sign in as the system administrator:
| Field | Value |
|---|---|
| Username | sysadmin@thingsboard.org |
| Password | sysadmin |
Set a new password.
The broker asks for one right away and signs you in when it is set. The Home page opens with a getting-started dialog that walks the same steps in the UI; close it with Got it! to follow this guide.
A new broker has a WebSocket Default Connection that points at ws://localhost:8084/mqtt and subscribes to
sensors/# with QoS 1. It needs port 8084 published, as in the command above.
Connect.
Go to the WebSocket client page and click Connect. The status changes to Connected.
Publish a message.
Below the Messages table, Topic is already sensors/temperature and the payload is {"temperature": 25},
in the JSON format. Change 25 to 32 and click the Send icon. In the JSON format the icon stays
disabled for a bare value such as 32; to send one, set Format to String first.
Check the result.
The message appears twice in the Messages table: as Published, and as Received through the sensors/#
subscription.
A new broker has Basic authentication enabled and one MQTT credential, TBMQ WebSockets MQTT Credentials: username
tbmq_websockets_username and no password, used by the web UI’s WebSocket Default Connection. Create credentials
of your own for your clients:
Open the credentials page.
Go to Authentication → Credentials, click + Add client credentials and choose Add client credentials from its menu.
Name the credentials.
Set Name, for example Getting Started Credentials, and click Next: Authentication and authorization.
Set a username and password.
This guide uses username and password. Leave the authorization rules as they are: the publish and the subscribe
pattern both default to .*, which permits any topic.
Save.
Click Add. A dialog, Client credentials created. Let’s check connectivity!, opens with ready-made
mosquitto commands for these credentials.
The examples use the Mosquitto clients.
Without them on this machine, use the Docker tab of that connectivity dialog: it runs the same clients from the
thingsboard/mosquitto-clients image.
Subscribe.
In one terminal:
mosquitto_sub -d -h localhost -p 1883 -t sensors/temperature -q 1 -u username -P passwordPublish.
In a second terminal:
mosquitto_pub -d -h localhost -p 1883 -t sensors/temperature -m 32 -q 1 -u username -P passwordCheck the result.
The subscriber prints 32. While it is connected, open the Sessions page to see its session.
A client that connects with a persistent session (clean session off, a fixed client ID) gets the QoS 1 and QoS 2 messages published while it was offline. TBMQ Lite keeps them on the data volume, so they also survive a restart of the broker.
Subscribe with a persistent session, then stop.
mosquitto_sub -d -h localhost -p 1883 -t sensors/temperature -q 1 -u username -P password -c -i my-devicePress Ctrl+C once the subscription is acknowledged.
Publish while it is offline.
mosquitto_pub -d -h localhost -p 1883 -t sensors/temperature -m 33 -q 1 -u username -P passwordOptionally restart the broker now with docker restart tbmq-lite.
Reconnect with the same client ID.
Run the command of step 1 again. The subscriber receives 33.
Each persistent client keeps at most 10,000 messages by default.
When a publish is acknowledged, what a crash or a power cut can lose, and the measured throughput. See Guarantees and limits.
The store, memory, listeners and TLS, health checks and metrics. See Configuration.
Back up from the UI, the REST API or the command line, and restore a backup or a pre-upgrade checkpoint. See Backup and restore.
Shared subscriptions, retained messages, last will, sessions and the UI pages. APPLICATION clients, integrations and clusters do not apply to TBMQ Lite. See User guide.
Was this helpful?