Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] java: publishing from the callback

Just to confirm what Dave has said I just tested sending messages from the MessageArrived callback in both 0.4.0 release and 0.4.1 snapshot and it worked fine.


On 13/03/14 16:01, Dave Locke wrote:
in messageArrived the application must return control as quickly as
possible.  If it blocks any new inbound messages will not be processed.
  Publishing using the non blocking i.e. async client within the
messageArrived is fine.   But do not wait for completion of the publish
within messageArrived using blocking methods like waitforcompletion.

All the best

From: Benjamin Cabé <benjamin@xxxxxxxxxxx>
To: General development discussions for paho project <paho-dev@xxxxxxxxxxx>
Date: 13/03/2014 11:37
Subject: Re: [paho-dev] java: publishing from the callback
Sent by: paho-dev-bounces@xxxxxxxxxxx



Any hints on this? Julien and I are finalizing the MQTT Tutorial for
EclipseCon and it¹s too bad that messages can¹t be published from the
MqttCallback (despite what the Javadoc says, which makes this even more


Le 11/03/2014 13:28, « Julien Vermillard » <jvermillar@xxxxxxxxxxxxxxxxxx>
a écrit :

 >With the java paho client, publishing a message inside the
 >"messageArrived" callback is
 >blocking the whole MQTT client.
 >It's supposed to be like that? It's not that complex to delegate the
 >publishing to another thread but I'm wondering if I missed something
 >paho-dev mailing list

paho-dev mailing list

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

paho-dev mailing list

Back to the top