powered by Jive Software

Smack 4.0.3 Spring web mvc 3.2.5 Java web application unable to receive chat messages instantly

Hii Experts,

I am using Smack 4.0.3 with my Java Spring Web MVC web application.

When I send a chat message to a Buddy, the message is sent without any delay, as is seen instantly on the Smack debugger (enabled SmackConfiguration.DEBUG). But, the message is received after a delay of approximately 1 minute.

I installed Wireshark on the same machine on which my project is running and the packet is received late on Wireshark also. This is causing a trouble creating an instant xmpp chat application. Your suggestions will really be helpful!

I installed Wireshark on the same machine on which my project is running and the packet is received late on Wireshark also.
It’s irrelevant when the message is received. What would be relevant to determine if Smack is causing the delay is when you see Smack putting the message stanza on the wire in a network tracer.

Thanks for your reply!

I used Wireshark as a network tracer and it is capturing the sent packet after a delay of approximately 1 minute from the time of sending the chat message using Smack.

Does it capture the packet being send or received?

It captures the packet being send and as soon as it is received on wireshark, the packet is forwarded to the XMPP server and the chat message is listened by the ChatManagerListener. The problem is the delay between the chat being sent by Smack and received on wireshark.

The problem is solved! I was using XMPPBOSHConnection to connect to the XMPP server which caused the delay. I replaced it with XMPPTCPConnection and now there is no delay, thereby making my chat application instant. Thank you all for the responses.