eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.12k stars 884 forks source link

messageArrived() callback fired randomly when there are multiple messages to read? #697

Open MirkoBianchetti opened 5 years ago

MirkoBianchetti commented 5 years ago

Hi, I'm using the library for an IoT application. Can happen that some time an external source publish onto the broker where my application is subscribed something like 100 messages (short messages, < 1kb each) all together, that have to be processed by the app. But if everything works well with the messageArrived() callback when there is a short amount of messages, in this case I see a strange behaviour with timing. In this case I can see the messageArrived() callback fired at a random delay, but it can takes also 3-5second between calls (the link with the broker is quick and stable). After some time it can accelerate for few seconds processing quickly 10/20 messages, than it restart to process messages slowly. What can it be? I'm using paho v.1.2.0 and I'm using a SyncClient with qos 1. Thanks everybody for help

money-yeye commented 4 years ago

Hi @MirkoBianchetti, I tried to replicate your problem but it seems that message handled by the callback are consumed in right way. How do you implemented it ? Can you give more details about your code?