Is Qpid Messenger known to work on Android? I ask because I think I am
seeing a race condition on Android only, but can't find much reference to
Messenger + Android on the web. Here's the problem:
When I do the typical put/send sequence in a Thread started from an Android
Activity, the message is not received by a subscribed peer. If I kill the
Activity, the peer will complain that the connection is broken. So it
seems that the connection is being made but the data is not sent. Here is
an example code snippet:
Messenger messenger = Messenger.Factory.create();
// do other things like create a message
messenger.put(msg)
// Thread.sleep(200)
messenger.send()
However when I uncomment the sleep statement above, the message is
received without any problem. The message is also received if I attempt
to debug to see what is happening in put().
I noticed that put() does not simply add the message to a queue, it also
uses nio methods to do some encoding of the message. I'm wondering if
since it is not blocking, is there some encoding method happening while the
send() is being processed, causing the message to be lost.
What are your thoughts?