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.
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:nextThe enable variable is CONNECTORSMQTT_ENABLE — no underscore between
CONNECTORS and MQTT. CONNECTORS_MQTT_ENABLE is silently ignored.
2 · Point your client at KubeMQ
mqtt://broker.example.com:1883
mqtts://broker.example.com:8883mqtt://localhost:1883
mqtts://localhost:8883Only 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:
mosquitto_sub -h localhost -p 1883 -t 'events/smoke/test'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.
MQTT connector getting started
The full publish-and-subscribe walkthrough across every language client.
Migrating from MQTT
The full cutover guide — topic-prefix mapping, compatibility matrix, and deviations.
Didn't work?
- Connector not enabled — the MQTT connector is opt-in; confirm
CONNECTORSMQTT_ENABLE=true(exact spelling, no underscore beforeMQTT) 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?
Replace AWS SQS & SNS with KubeMQ
Point your AWS SDK or LocalStack-style endpoint at KubeMQ's drop-in SQS/SNS connector — no rewrite; verify with the aws CLI or boto3.
Replace Google Cloud Pub/Sub with KubeMQ
Point an unmodified Pub/Sub client at KubeMQ by setting PUBSUB_EMULATOR_HOST — enable the connector and verify.