Publish an MQTT message

Send a JSON temperature reading to your broker, then check the received message in MQTT Viewer.

About 3 minutes · MQTT Viewer 1.2 · Web UI screenshots

Before you start

Open a connected broker in MQTT Viewer. Use a test broker where you can publish to walkthrough/office/temperature. In the connection's Subscriptions, include walkthrough/# or # so the message comes back to this connection.

1. Start a message

In the connection sidebar, click New message.

Connection sidebar with New message highlighted beneath Walkthrough broker
New message opens the publish editor. Full size (opens in a new tab)

2. Enter the topic and payload

In Enter a topic, type walkthrough/office/temperature. In the Payload tab, replace the editor contents with:

{
  "temperature": 23.4,
  "unit": "C"
}
Publish editor containing topic walkthrough/office/temperature and a JSON payload with temperature 23.4 and unit C
Use the full topic name, without MQTT wildcards. Full size (opens in a new tab)

3. Publish the message

Leave QoS 0 and Don't Retain selected, then click Publish.

These settings send the reading without asking the broker to keep it for future subscribers.

Publish controls with QoS 0 and Don't Retain selected, and the Publish button highlighted
Publish sends the message to the connected broker. Full size (opens in a new tab)

4. Check it arrived

In List, expand walkthrough, then office. Select temperature to see the received payload in the topic panel.

MQTT Viewer showing the published JSON in the editor and the received temperature reading in the selected-topic panel
The topic panel shows the message received through your subscription. Full size (opens in a new tab)

You should see "temperature": 23.4 and "unit": "C". The sent message is also saved in History, ready to edit and send again.

If the message does not appear

Check the connection is still connected, clear the tree filter and check the subscription matches the topic. No matching subscription means you can publish, but this connection will not receive that topic. Check your broker permissions if publishing fails.