Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the openfire's user remains ONLINE even with no SESSION exists in sessions

I'm developing an android app contains "Messaging" using OpenFire as an XMPP server and using Smack for android client. All functions works fine, but when a user is online(as you can see it's state in admin panel of openfire), and network connectivity disconnected suddenly, the session of it will be destroyed, but the user remains ONLINE in server! Thus, the packets not stores in server as an offline messages and will be sent to user even the user is offline and packets will be lost! I was tested an windows client (Spark), but when its connectivity losing, session in server will be destroyed and the user immediately turns to OFFLINE! What can I do to solve this problem? User1 is online but has no session

like image 650
Mahdi Moqadasi Avatar asked Feb 19 '18 12:02

Mahdi Moqadasi


2 Answers

This behavior is likely introduced by an XMPP feature called Stream Management.

In short, this feature allows for clients that briefly disconnect to pick up where they left off, without doing all of the things associated with a normal connect (which tends to involve a lot of resources).

This is useful for clients with spotty network connectivity, or devices that kill connections when putting an application to the background, like on mobile phones.

Openfire implements this functionality. Note that packets are not 'lost', as you describe. Instead, all of the unhandled packets will be buffered, and, when the client is 'to late' to reconnect (a timeout applies, I think the default is 3 minutes), those packets will be treated as if they were sent to a disconnected device.

If you want, you can disable this feature by setting the 'stream.management.active' property to 'false' (but for typical setups, you don't want this, as the Stream Management functionality serves a good purpose).

like image 103
Guus Avatar answered Nov 18 '22 20:11

Guus


This is a bug with keepalive mechanism. Please check this:

https://issues.igniterealtime.org/browse/OF-963

I am having same issue with version 4.2.3. Switched back to 4.0.2. Issue is reported for version 4.0.3.

like image 41
Kenan Begić Avatar answered Nov 18 '22 22:11

Kenan Begić