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

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
Dave

 



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





Hi,

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
confusing).

Thanks!
Benjamin


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

>Hi!
>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
>here.
>
>Thanks,
>Julien
>_______________________________________________
>paho-dev mailing list
>paho-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/paho-dev
>


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev



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

Back to the top