New Synadia Agent Fabric is in public preview

Synadia MQ Gateway · Public preview

Standardize on NATS, even if some of your clients speak MQTT or AMQP

Re-point your MQTT (3.1.1 and 5.0) and AMQP 1.0 clients at Synadia MQ Gateway, and every message becomes a NATS message. No extra broker to run.

Already using NATS’s built-in MQTT listener? See what the gateway adds.

web shopamqp

Routed orders: sent

transfer → orders region=EU amount=1200

NATS subject

orders.EU

  • EU desk
  • EU large orders
  • dashboard
  • audit

Example playground output

  1. 1Client publishes
  2. 2Gateway translates
  3. 3Subscribers receive

Companies running vehicles, chargers and energy infrastructure on NATS

  • Logo of Rivian
  • Logo of PowerFlex
  • Logo of May Mobility
  • Logo of Eviny
  • Logo of Verrus

Keep your clients. Retire the other brokers.

Your PLCs, vendor devices and AMQP applications connect to MQ Gateway instead of a broker of their own. They keep their protocol and client libraries.

Without MQ Gateway

3 systems to run

Each has its own users, storage and cluster, and bridges carry messages between them.

MQTT devices AMQP apps NATS services MQTT broker AMQP broker NATS bridge bridge

With MQ Gateway

1 system to run

Every client lands on NATS, so there is one set of users, one store and one cluster.

MQTT devices AMQP apps NATS services MQ Gateway translates, stores nothing NATS routes, secures and stores MQTT AMQP NATS NATS

NATS already speaks MQTT 3.1.1

Clients on 3.1.1 can connect straight to NATS with no gateway. Add MQ Gateway for MQTT 5 and AMQP 1.0, or if you need more control over how MQTT runs in production.

What you need Built-in listener MQ Gateway
MQTT 5 clients Refused at connect 3.1.1 and 5.0 on the same port
AMQP 1.0 and JMS None Yes, with some JMS limits
Storage control Streams the server creates and manages for itself You bind topics to your own streams, with your own retention, replicas and limits
A reliable publish is refused MQTT 3.1.1 has no reason codes MQTT 5 devices get a reason code
When a NATS server restarts MQTT clients on that server disconnect and reconnect. Sessions survive in JetStream Most devices stay connected. Only the gateway’s NATS connections move
Hub and leaf sites with JetStream domains All MQTT state is pinned to one domain Each binding can name its own domain
Sparkplug B, retained messages, wills, sessions, WebSocket, TLS, accounts Yes Yes

If every device speaks MQTT 3.1.1, the server’s default retention suits you and your devices can reconnect during NATS upgrades, the built-in listener is often enough.

How MQ Gateway works

The gateway stores nothing itself. Messages, sessions and permissions all live in NATS.

  1. Your client publishes

    Over MQTT or AMQP, with the library it already uses

  2. The gateway translates

    The topic orders/EU becomes the subject orders.EU

  3. NATS routes and secures

    Using your NATS users and permissions

  4. JetStream stores

    On topics you bind, before the client is acknowledged

  5. Subscribers receive

    As an MQTT topic, AMQP address or NATS subject

Messages flow both ways: a NATS service can publish to MQTT and AMQP clients too.

Questions we get about MQ Gateway

Straight answers on what it is, how it works, and what it doesn’t do.

What is MQ Gateway?

MQ Gateway is a Synadia product that connects MQTT and AMQP clients to NATS. Devices, PLCs and AMQP applications keep their protocol and their client libraries, and every message they send becomes an ordinary NATS message. That lets teams retire a separate MQTT or AMQP broker and run one messaging system.

NATS already speaks MQTT. Why use MQ Gateway?

MQTT 3.1.1 clients can connect straight to NATS through its built-in listener, with no gateway. MQ Gateway adds MQTT 5 and AMQP 1.0. It also gives you storage you define per topic, a reason code for MQTT 5 devices when a reliable publish is refused, bindings that can each name a JetStream domain, and most devices staying connected while NATS servers restart. If every device speaks MQTT 3.1.1, the server’s default retention suits you and your devices can reconnect during NATS upgrades, the built-in listener is often enough.

How does MQ Gateway work?

Clients connect to the gateway over MQTT or AMQP, and each connection becomes its own NATS connection, authenticated as a NATS user. The gateway converts topics and addresses to NATS subjects, so the MQTT topic orders/eu and the AMQP address orders.eu are the NATS subject orders.eu. QoS 0 and presettled AMQP messages travel over core NATS. QoS 1, QoS 2 and unsettled AMQP messages are stored in JetStream streams you bind, and the client is acknowledged once the stream has stored them.

Which protocols and clients does MQ Gateway support?

MQTT 3.1.1 and 5.0 over TCP or WebSocket, Sparkplug B, and AMQP 1.0. It works with clients such as Eclipse Paho, Ignition and Apache Qpid. Some JMS features aren’t supported yet, so check the compatibility page.

Can a NATS service send messages to MQTT and AMQP clients?

Yes. A NATS client publishes to a subject, and MQTT and AMQP clients subscribed to the matching topic or address receive it through the gateway. A plain publish reaches MQTT clients at QoS 0 with no properties. For QoS 1 or 2, bind the subject to a stream and set the Mqg-QoS header. Other Mqg-* headers set the content type, correlation ID and properties that MQTT 5 and AMQP clients see. Request and reply works in both directions too: a NATS request reaches MQTT 5 clients with a Response Topic and AMQP clients with a reply-to address, and a NATS service can answer requests from either.

How do clients authenticate?

Every MQTT or AMQP connection becomes its own NATS connection, as a NATS user, and the listener it connects to decides which user. A client can log in with its NATS username and password, share one configured user with every client on that listener (for devices that can’t hold a credential), or present a TLS client certificate that your NATS auth callout service maps to a user. NATS accepts or refuses the credential and applies that user’s permissions, so the gateway has no permission system of its own. The gateway doesn’t check certificate revocation, so refuse a revoked certificate in the callout service.

Can I move an application to MQ Gateway without changing it?

Usually you re-point the application at MQ Gateway and keep its client library. Perfect portability isn’t something any broker move can promise, because MQTT and AMQP brokers each implement different features of their specifications. Check the features your application relies on against the compatibility page first.

How does MQ Gateway handle AMQP selectors?

MQ Gateway pushes as much filtering as it can to NATS, using filter subjects on a JetStream consumer. When a selector depends on properties a subject can’t answer, the gateway receives the message on the client’s behalf and evaluates the selector. If the selector is false, the gateway doesn’t deliver it to that client, and on a stored address it acknowledges the message.

Is MQ Gateway an MQTT broker?

No. MQ Gateway translates MQTT and AMQP into NATS, and NATS does the brokering. NATS routes every message, applies every permission and stores what must be kept, so you run one system instead of a NATS deployment plus HiveMQ, EMQX or Mosquitto.

Can MQ Gateway replace our AMQP or JMS broker?

For many AMQP applications that use queues and request/reply, yes, and selectors work with some limits. MQ Gateway doesn’t currently support transactions, dead-letter queues, delivery delay, or durable and shared subscriptions, so check the compatibility page if you rely on them.

Does MQ Gateway support RabbitMQ clients?

Not over AMQP 0.9.1, RabbitMQ’s classic protocol, which MQ Gateway doesn’t currently support.

Do I need Synadia Platform to run MQ Gateway?

No. MQ Gateway is a standalone product that works with a NATS system you run, including OSS NATS. The free 30-day trial includes the licensed build and a license.

Where can MQ Gateway run?

MQ Gateway runs on Linux, macOS or Windows, on amd64 or arm64, or as a container image. You can run it next to a central NATS cluster or at a site on a leaf node. Where sites have their own JetStream domains, each binding can name its own domain, while the built-in NATS listener keeps all MQTT state in one. The binary needs nothing else on the machine.

What happens when a gateway or a NATS server stops?

Run two or more gateways on a NATS cluster with a sessions bucket, and sessions and stored messages outlive any one of them. If a gateway stops, clients reconnect to another gateway and MQTT persistent sessions resume there. Upgrading a gateway uses lame duck mode, which moves clients a few at a time. If a NATS server stops, most clients stay connected and stored deliveries pause for a few seconds.

Can MQ Gateway deliver a message twice?

Yes. After a failure, a QoS 1 or 2 or unsettled AMQP message can arrive twice and possibly out of order, as with any at-least-once delivery. Clients that must not act twice should de-duplicate on an ID.

Is MQ Gateway generally available?

Not yet. MQ Gateway is in preview. Start a free trial or read the docs.

Try MQ Gateway free for 30 days

Works with OSS NATS. Re-point your clients, no Synadia Platform required.

How to get started

Sign up for a trial

Submit the form to request your free 30-day trial.

Get your trial license

Receive an email with links to the licensed build and your trial license JWT.

Install the gateway

Download the mq-gateway archive for your platform, or pull the licensed container image.

Start the gateway

Put the JWT in a file, then start mq-gateway with --license.file, --mqtt or --amqp, and your NATS server URL.

Explore the docs

Try the playground, then read how bindings, streams and buckets fit together.

View docs

MQ Gateway is a standalone product. Contact us for pricing.

Get the NATS Newsletter

News and content from across the community


Cancel