powered by Jive Software

Offline messages to online users?

I use Smack 4.3.1 based clients with an Openfire 4.3.2.

I have 2 clients: client1 & client2 (And when client2 restarts, they are the same user as before)
Chatting works fine.
Client2 closes, client1 keeps sending messages.
Clients 2 opens again and receives all the messages sent so far.
Client1 sends another message to client2 while client2 has not send any message to client1.
Client2 does not receive the message.
If client2 sends any message to client1 they will receive all following messages from client1.
Client2 closes and opens again (again) and receives the messages client1 sent before the previous client2 sent a message.

So: It seems that client1 sent an offline message to client2 while client2 was online

Is this a server side Openfire problem? Or a client side problem? How can I fix this?
The XMLs being sent always look the same message body “text” /body /message



First you need to determine the entity which is causing this. If Smack sends the message stanzas out but the server does not deliver it to the client, then I would look into the server, not into Smack.

Obviously the problem was client side (Openfire worked flawlessly with other Clients)
I deleted Smacks ‘ChatManager’ with its ‘chat’ from my own code because they cached the FullJid of the absent client (in my example client2).

Now I send messages with

connection.sendStanza( message ); // before: chat.sendMessage( message )

The message itself only knows the BareJid of the receiver - it works.

How can I improve ChatManagers behaviour? I guess i did something wrong with Presences

// ChatManager
if (chat.lastPresenceOfLockedResource == null) {
return;} // it returns here instead of unlocking the Resource

Or other clients use a different “pattern” when sending messages.

That suggest that Openfire may not route messages addressed to a full JID if there is no such available resource as per RFC 6121 § Or did you possibly send messages of type ‘normal’?

It is hard to tell what is really going on with the information you provided. A stanza trace sure would be helpful. See also this Smack wiki page.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.