powered by Jive Software

Messages are lost when client connection closes unexpected

Scenario:

Openfire is configured to store offline messages

  1. Connected XMPP client loses it’s connectivity (Airplaine mode on a smartphone, etc.)
  2. Send a message to the client, which still shows up as online
  3. After 5 minutes (I think this is the default client connection timeout) the client goes in offline state
  4. Client reestablishes the XMPP connection somehow and does an offline message retrival
  5. The Message send in 2. is not part of the cached offline messages.

It would be nice if openfire would put the message from 2. in the offline messages pool for the client. Therefore I’d like to make a future request. Or is this already implemented somehow? Then what’s needed to make it work as one would expect it.

Can someone point me to the source code part that is responsible for incoming client messages?

Flow

You will probably have to wait (or develop and contribute) for this OF-446. With that feature Openfire will have to get a response from a client, that a message has been received. Note that this requires a support on the client side too. Not an easy feature and if no wise java programmer contributes, then we won’t see it implemeted for years.

You can also try to set xmmp.client.idle system property as low as you see appropriate for your environment. This is in miliseconds. It should disconnect a client, if it doesn’t do anything active in that period of time. Of course this will only reduce the amount of not received messages. Though i’m not sure how it will work in your case.

Thanks for your reply wroot. Lowering client.idle won’t be a good idea on my situation, because I have an mobile (GSM) client environment, therefore it’s wise to send as few data as possible.

Stream Management would be great though, I made the initial request, but I think that it’s more realistic that someone would pick-up this TODO: http://fisheye.igniterealtime.org/browse/openfire/trunk/src/java/org/jivesoftwa re/openfire/nio/ConnectionHandler.java?hb=true#to137

I didn’t dig deep into the source yet, but this should be the culprit in my scenario. It seems that openfire just discards all pending messages on an IoSession exceoption. Which would lead excatly to what I described in the original post.

Could you open an issue report for this?

Here you go. OF-464 Maybe Guus will have better naming/description for this or some comments.

Hi, I encountered the same problem as you did. Does the most up-to-date version of openfire resolve this problem? Or some plugin can support this? If not, do you know any open source xmpp server that can do the task?