powered by Jive Software

Record all the data in Server

i am new to XMPP. I was working on sending a mesage from one client and receiving it at the other end. It worked fine. i used Smack API.
Now, I want to store all the messages that has been received by the XMPP server and store it in a DB. This is for the admin.
Initially I thought of having a Global acct so that all the sender shld send one packet to their intended receiver and one packet to the global acct. But sending two packets might be costlier.
Is there any other way to perform this?

Thanks in advance



There are a few options for this. Normally, you would implement this on the server-side using the Openfire API instead of using the Smack API on the client-side. Openfire already includes the ability to log all chat messages that pass through the server to a log file. If you log into the Openfire admin console and then go into Server -> Server Settings -> Message Audit Policy you can enable this functionality. Depending on your needs, this may be enough for you. If you need more customization, you can create a simple Openfire plugin. I implemented something similar before the auditing feature was available and it doesn’t take very much code at all. I used the Content Filter Plugin as a starting point since it was already inspecting all packets and then just tweaked it for my needs. You could also start with the Openfire Plugin Docs or get more help on the Openfire Forums.

Thanks for the suggestion