KubeMQ
DeployScenariosReplace your messaging stack

Replace MQTT with KubeMQ

Change your MQTT broker host to KubeMQ's drop-in connector — 3.1.1 and 5.0 clients connect unchanged; verify with mosquitto.

You need a license key to start KubeMQ — it's free, about 2-3 minutes (it includes creating a free account). Get one. Step 1 below starts the broker with the connector enabled.

Your existing MQTT client keeps its library, its code, and its publish/subscribe calls — only the broker host changes. MQTT 3.1.1 and 5.0 clients both connect unchanged (MQTT 3.1 is rejected at CONNECT).

Drop-in level: endpoint-only (legend)

1 · Enable the connector

The MQTT connector is disabled by default — enable it and publish its ports:

docker run -d \  --name kubemq \  -p 1883:1883 \  -p 8883:8883 \  -p 8083:8083 \  -p 50000:50000 \  -e KUBEMQ_TOKEN=YOUR_LICENSE_KEY \  -e CONNECTORSMQTT_ENABLE=true \  europe-docker.pkg.dev/kubemq/images/kubemq:next

The enable variable is CONNECTORSMQTT_ENABLE — no underscore between CONNECTORS and MQTT. CONNECTORS_MQTT_ENABLE is silently ignored.

2 · Point your client at KubeMQ

Before — existing MQTT broker
mqtt://broker.example.com:1883
mqtts://broker.example.com:8883
After — KubeMQ
mqtt://localhost:1883
mqtts://localhost:8883

Only the host:port changes. Topics keep working as-is if they don't start with a reserved prefix (events/, store/, queues/, commands/, queries/) — those prefixes select a KubeMQ messaging pattern; everything else routes through the default pattern.

3 · Smoke test

Adapted from the MQTT connector's verification smoke test:

Terminal 1 — subscribe
mosquitto_sub -h localhost -p 1883 -t 'events/smoke/test'
Terminal 2 — publish
mosquitto_pub -h localhost -p 1883 -t 'events/smoke/test' -m '{"ok":true}'

You should see, in Terminal 1:

{"ok":true}

What carries over — and what doesn't

Your MQTT library, connection code, and publish/subscribe calls carry over unchanged for both 3.1.1 and 5.0. Retained messages are rejected (not silently dropped), MQTT 3.1 is rejected at CONNECT, and RPC over MQTT only works on 5.0 — see the full deviations list below.

Didn't work?

  • Connector not enabled — the MQTT connector is opt-in; confirm CONNECTORSMQTT_ENABLE=true (exact spelling, no underscore before MQTT) was set when the container started.
  • CONNACK rejected the connection — check your client isn't sending MQTT 3.1 (protocol level 3); use 3.1.1 or 5.0.
  • Message never arrives — subscribe before you publish (Events is fire-and-forget), and check your topic's first segment isn't unintentionally colliding with a reserved prefix (events/, store/, queues/, commands/, queries/).

Was this page helpful?

On this page