Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] HTTP - MQTT bridge

Hi Bharath,

you shouldn't need to do anything different for a REST application in particular.  You might need to be aware of when client objects are created and destroyed, though. 

If a client object is created, connect and subscribes and then is destroyed, if you want it to receive messages for those subscriptions when it is recreated and reconnects, you must:

1) connect non-cleansession (otherwise the subscriptions are deleted on disconnect)
2) make sure the client persistence is turned on and pointing to the same location so that client state is restored when it is recreated


On 03/13/2014 09:47 AM, Bharath C wrote:

Hi All,


I’m developing an HTTP-MQTT bridge.

HTTP/REST side I’m using Jersey rest framework.


My requirement consist publishes a messages and then subscribe to its response.

I’m able a publish a Message using a MQTT client during POST method.

But, I don’t get any messages when its been subscribed. I’m not sure what changes I need to do in perspective to REST.

Since its works fine in normal JAVA application.


Should I use different mqtt clients for pub and sub,

I tried Async client which was working fine in normal java application but in REST it is not working.


Please help me understand if this the MQTT functionality or my ignorance.





Larsen & Toubro Limited

This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.

paho-dev mailing list

Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Comitter on Paho, Mosquitto

Back to the top