You can add a system property in Admin Console: xmpp.client.idle
and set it to some value in miliseconds. I have it as 30000, which means that Openfire closes idle sessions (which are not showing signs of life, not sending keepalive packets) after 30 seconds. You can make it shorter, but then you can have lots of sporadic disconnects with your clients, especially if connection is not good.**
**
Usually it takes some time for this setting to get applied. But you can try restarting the server after setting it to make sure it is applied. In my testings it works, it takes 30 seconds to change the status after i plug off the cord out of my PC. Try setting it to 10000 or 30000 first to see if that works. Even if you set it to 1 milisecond, this can’t guarantee 100% that you won’t lose any message. There are some other protocols to mitigate this, but not all are supported by Openfire.
OF-434 - a client has to have support for this, to show that message has been received by the other side (or not). Spark doesn’t support that.
OF-446 - Openfire doesn’t support it. Smack/Spark doesn’t support that either.