Hi All,
I am currently developing an MQTT-SN Gateway that bridges MQTT-SN clients to a standard MQTT broker. I am using the Eclipse Paho Java client library to handle the connection between the gateway and the broker.
Currently, when I call .publish() with QoS 2, the Paho library handles the PUBREC, PUBREL, and PUBCOMP packets asynchronously behind the scenes, eventually just returning a delivery token. This means the QoS 2 handshake is happening locally between the Gateway and the Broker.
What I want to achieve is for the gateway to function solely as a translation protocol. This means the gateway should not contain any internal QoS state logic, but rather act purely as a protocol translator between the UDP client and the TCP broker.
To do this, I need to facilitate the following end-to-end flow:
The MQTT-SN Client sends a PUBLISH (QoS 2) to the Gateway, which relays it to the Broker.
The Broker replies with a PUBREC, which the Gateway intercepts and relays back to the Client.
The Client sends a PUBREL, which the Gateway relays to the Broker.
The Broker replies with a PUBCOMP (releasing the message), which the Gateway relays back to the Client.
My question is: Does the Paho Java library expose any low-level APIs or interceptors that would allow me to manually handle these QoS 2 control packets?
Best regards,
Rayner