powered by Jive Software

Sending custom packets over s2s

hi,

i have set up a component in jive which is capable of recieving packets. once i get a packet, i want to send it to its proper destination, which could be on any jabber server.

i am able to create an s2s session by using the OutgoingServerSession class. this can also be seen in the admin console.

the i use the process() method of this class to send my packet. not only does the packet not get sent, i also get a null pointer exception. i have printed the text and seen that the packet is not malformed or anything like that.

can someone please help me out ?

Hey akshat,

The best entry point for sending Messages is to use MessageRouter. There is no need to manually create a session or manipulate other “internal” objects. MessageRouter will take care for sending the message to local users as well as remote users or even store the message if the local usere is offline.

To get the MessageRouter you can use XMPPServer.getInstance().getMessageRouter()[/code]. Use #route(Message) to send the message.

Regards,

– Gato