in the Spark client sometimes i receive both messages and sometimes only the first.
In the other hand, if i do:
(…)
chat.sendMessage(“Message1”);
TimeUnit.SECONDS.sleep(1);
chat.sendMessage(“Message2”);
(…)
then the Spark client always receives both messages.
In the debugger i can see the xmpp traffic is exactly the same in both cases (with the sleep() and without it).
I’'ve tried both with smack 2 and smack 3.
What could be the problem? XMPP does not guarantee delivery of messages? is this an implementation issue? who is the “culprit” (smack, wildfire, spark…)?
I pressed F12 in Spark and used “XMPPConnection.DEBUG_ENABLED = true;” on my custom code, so i could see what is sent and what is received.
I can confirm that the Spark debugger shows both messages are received always, but the GUI, when the two messages are sent “too fast” most of the times only shows the first one.
The debug output on my custom code:
It seems we have the culprit -> Spark
So maybe this is a problem on Swing threading or something similar?
really interesting. I hope that you are using Spark 2.5-beta3 (which uses Smack 3).
If you close Spark’'s receiving Window and open it again it should display the recent chat history. I wonder if you see then both messages, then this would be “only” a display issue, otherwise Spark would lose these messages.
Unless you don’‘t have a Windows or OSX client it’'s a little hard to make progress on the “flow control” issue. I did report it to Derek and would like to create an issue if this problem still happens with Spark 2.5-b3.
SPARK-570 for those who want to vote for it or track it.
How did you know i was using java 6?
I didn’'t but following the links above one can read that Java6 has this problem much more often than Java5. And Beryl users seem to have this problem more often than KDE users.