I'm building a chat application using xmpp over Ejabbered for server and smack for android client
I've established connecting , login , send and receiving messages ,then I've faced a problem with user network disconnecting and reconnecting , which has been solved by Reconnecting Manger in smack and xmpp-0198, however there is a case where i need to create a new connection in smack but use the previous session (stream) to get all the messages stored in that session (they don't get stored to offline messages) ,and if i create a new connection with new stream id , user messages get lost .
so is there a connection constructor to implement this solution . or server side configuration to store thous messages to offline messages
after lots of searching ,finally i upgraded Ejabberd server to the latest version 17.03
where they've added the new module mod_stream_mgmt ,and changed the behavior of stream management , so when i create a new connection it get rebind to the old one and receive the unsent and un-handled messages
to activated the mod_stream_mgmt i used the following configurations :
mod_stream_mgmt :
resume_timeout :60
resend_on_timeout: true
Note : I have also activated mod_ping on server side ,I don't know if that has a direct effect on this process and case but right now my clients are not missing any messages .