Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Unable to confirm delivery without setting messageArrived callback

Hi Adrian,

that was a deliberate decision on my part.  If no messageArrived callback is set, then no incoming messages can be sent to the application.  This would cause the library a dilemma, so I felt it a good idea to insist on a messageArrived callback being implemented. 

Also, I do know that some MQTT servers can send unsolicited messages to a client.


On 09/23/2016 10:31 AM, Moran Adrian wrote:

Hi all,

with the current version of C Paho client is not possible to confirm messages delivery without setting the messageArrived callback.


File src/MQTTAsync.c --> Function MQTTAsync_setCallbacks()



if (m == NULL || ma == NULL || m->c->connect_state != 0)




m->context = context;

m->cl = cl;

m->ma = ma;

m->dc = dc;




Why is needed ma (messageArrived) callback to be set to work with dc (deliveryComplete) callback? I will just replace if condition by the following one:


if (m == NULL || m->c->connect_state != 0)


I think that subscription and publication are completely independent tasks, so I don’t know if it is a bug or something I don’t have clear enough.


Thank you so much,

Adrián M.

paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto

Back to the top