powered by Jive Software

processMessage not being called

I’m having problems with processMessage.

I have two clients, both of which implement MessageListener.

The first client uses connection.getChatManager().addChatListener to register itself as a MessageListener.

The second client then creates a chat with the first client, using connection.getChatManager.createChat() with itself as the MessageListener.

The second client then sends a message to the first client, which is properly handled by its processMessage method.

The first client can send messages to the second client which are handled by its processMessage method.

However, after that when the second client sends another message to the first, processMessage apparently is not being called (I have a System.out.println as the first line in the processmessage method). I can see in the debug window that the message has been received. I know the chat object still exists because the fist client can use it to send messages to the second client.

Does anyone have any ideas as to what the problem could be? Searching through the forum I saw a couple posts by people who semed to have similar problems, but the message were years old and didn’t have any answers.

George

1 Like

Are you creating a new Chat in the second client each time you send?

Without seeing your code it’s going to be hard for someone to help you out.

I figured out what I was doing wrong. I was trying to have two clients chat with each other, with a message recived by one client triggering it to send a message to the other client. The problem is, the processMessage in one client never actually completed, so it was blocking the thread smack was using to call processMessage.

Well it seems I too have the same problem. How did you solve it? Could you please help me out?

I encountered the same problem too. It is strange that i can only receive message from another client, only after i sent a message to that client. Strange.