This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

Send Message to Offline User in XMPP outbond adapter not result in errorPage Title Module

Send Message to Offline User in XMPP outbond adapter not result in error

Jul 19th, 2013, 05:28 AM

Hi everyone,
I have some problem with xmpp adapter. I want to make xmpp outbond adapter raise error whenever it send message to offline user. I have try it and no error was raise when sending message to offline user.
Is there a way to achieve this?
Thanks & Regards.

Comment

I'm not well with XMPP, but I dug Google and read Smack source code and now try to help you .

1. XMPP protocol allows to send massages to offline users. Messages will be stored on the server before user will become online. That's why you don't get an error.
2. To check user status you can use Roster.getPresence(user).isAvailable().
3. So, what you need it is getting the user's status before sending message to our chat.

Only one place I see just to intercept the Packet before it will be placed to the internal PacketWriter's queue.

What I suggest to implement your own org.jivesoftware.smack.PacketInterceptor: