Search code examples
spring-bootarchitecturemicroservicesiotapi-gateway

API Gateway with MQTT support (IOT)


Recently I am working with along with IOT department, right our project is on discussion and creating core architecture of an application. client specification is we must use MQTT protocol to communicate between device and java application (eclipse paho client). its a web application based on spring boot and microservice architecture. but I an not able to find any good solution for API gateways that provide MQTT support.

I found zuul is good but do we have any alternative like kong..


Solution

  • MQTT is a TCP stream based protocol, so API Gateways that operate on the HTTP / Layer 7 are not going to fit the bill.

    There are extensions to commercial API Gateways available, such as the Axway MQTT Proxy described here.

    While not an API Gateway, Confluent also have a MQTT proxy that allows simple integration with Kafka, however if you have already written an application that implements the backend then Kafka is going to require some re-architecting.

    The other options are really going for a simple TCP stream reverse proxy like nginx or HAProxy.

    If I was asked to build something like this, I'd go straight to Kafka. It and MQTT are a very neat architectural fit and also operate very well together but it really depends on your requirements.