powered by Jive Software

Chat Message persistence

Hi all,

I am a newbie to “OpenFire”. I setup a simple chat session between two users. I was trying to figure out as to where openfire was storing the chat messages. I looked in the underlying database. (ibm db2 v9.5 configured per openfire instructions). I could not find the message. I looked in the filesystem of the server and could not find these messages. I even ran extensive jdbc-trace sessions and did not find anything.

Are these messages encrypted and/or encoded ?. Can anyone shed some light on this ?.

Regards

/ramakrishna

Requires a monitoring plugin to archive the messages, and after installing some OPF console config updates to enable. The messages would be stored in the DB.

HTH

Hi HTH,

With apologies, but could you clarify what OPF stands for ?. (Does it stand for OpenFire ?)

Secondly, my question was geared towards “How does the out-of-the box server work” ?. Specifically for message persistence.

  1. In some experiments that I did, I see that messages are persisting. This is after I disconnect my clients, re-boot my server etc. This suggests that these messages are being persisted someplace. I could not find them being stored in the DB nor filesystem nor on the client-side. Hence this mystery.

  2. I realise from the spec (rfc3290) that after a tcp-session is establised between the clients an “xml-stream” goes back and forth. Further this is perhaps encoded in some form. (base64 ?). So, a human eye may not pick these up and we may need to use some decoding tool on the stream. But this is besides the point. The big mystery to me is where are these messages stored such that they re-appear after re-starting clients & servers.

/ramakrishna

By abbreviation “OPF”, I meant Openfire, similarly, “HTH” meant “Hope That Helps”.

  1. In some experiments that I did, I see that messages are persisting. This is after I disconnect my clients, re-boot my server etc. This suggests that these messages are being persisted someplace. I could not find them being stored in the DB nor filesystem nor on the client-side. Hence this mystery.

Out of the box, the Monitoring Service*1 plugin does not install, so you would never see this happening by your current methods. However, multi-user chat can be logged (see tables ofMucConversationLog). After the initial install is established, you would need to enter the Openfire Admin Console, typically running on “http://localhost:9090/”, and login with credentials you specified during initial install.

Through plugins, the OPF server’s capabilities are extended, and is perhaps one of the (many) good design qualities of the server itself. It appears you have gotten to the Admin console already, so from there go to “Plugins” tab, and install the Monitoring plugin. Once that is done, you can set how you want conversations archived. Chat conversations ***will be logged to the database (*see tables OfConversationLog, IIRC) after a “flush” timer (also an option for specification).

  1. I realise from the spec (rfc3290) that after a tcp-session is establised between the clients an “xml-stream” goes back and forth. Further this is perhaps encoded in some form. (base64 ?). So, a human eye may not pick these up and we may need to use some decoding tool on the stream. But this is besides the point. The big mystery to me is where are these messages stored such that they re-appear after re-starting clients & servers.

The format is ASCII text, seen by command, tcpdump -X -s 0 port 5222, unless encrypted, which would appear as a mix of hex characters.

HTH,

BEA

Refs:

*1 http://www.igniterealtime.org/projects/openfire/plugins.jsp

Hi slicer321,

Thanks for your detailed suggestion. My experience todate …

  1. My environment

OS : Windows Vista Home Premium on HP Pavillion dv9000 series.

Database : IBM DB2 V9.5

OpenFire : version 3.6.3

JDK : 1.6 (update 12)

  1. I installed the “monitoring” plugin. The installation was error-free. However the “UI” for that is supposed to show up on openfire’s admin console did not happen. (http://www.igniterealtime.org/projects/openfire/plugins/monitoring/readme.html). Further it threw a java.io.FileNotFoundException about

c:\Program Files\OpenFire\monitoring\search\indexprops.xml. The directory “monitoring” did’nt come with the original openfire installation.

So, this experiment stopped after going this far.

  1. I did not see the table OfConversationLog that you mentioned. What does IIRC mean in that context ?. I have earlier seen the OfMucConversationLog and seen “inserts” into it in a MUC (Multi user chat) session. I have also managed to see basic chat messages being written to the logfiles. (jive.audit-xxx.log files) when that selection is made via the admin interface. (Message, Presence & IQ were logged).

Although, the server design may have many niceties to it’s credit, the fact that such an elementary thing does’nt work out of the box is a damper for me.

  1. My original question is still not answered. i.e the out-of-the-box openfire server + spark-client exhibits message persistence in a simple chat session. (Not multi-user). Where are the messages being persisted ?.

  2. I see that MySQL is by far the popular database being used. Since, I have tried this on DB2, I am wondering if DB2 is the issue. I saw some more messasges on the forum wherein users ran into issues where plugins were’nt doing the right thing for DB2. DB2 is perhaps not getting sufficient QA.

  3. Much thanks for your explanation w.r.t wireline encoding of messages and the suggestion to use the “tcpdump” utility.

I will continue my experiments and post my results.

Cheers …

/rk

Some more experiments reveal …

  1. The “monitoring” plugin works on Linux/DB2/OpenFire stack. Details …

OS : RHEL 5.x

DB : IBM DB2 V9.5

OpenFire v3.6.3

JDK 1.6.x

monitoring plugin 1.1.1

  • The plugin installs correctly. It shows the two extra tabs on the admin tool. (statistics & archiving).

  • Chat messages get archived to the table “OfMessageArchive” and not “OfConversationLog”.

  • Search is’nt quite working well though.

  1. My original mystery is solved. Basically the “client” stores a bunch of messages locally. Poor debugging on my part.

Should have discovered this far back. :frowning:

  1. The “tcpdump” thing is’nt quite working well yet. I am not able to decipher the “messages on the wire”.

Slicer321, Many thanks for your hints/suggestions though.

Onwards …

/rk

Ah yes, I was also thinking the chat logs could be stored on the client side(!). The tcpdump tool is best on UNIX style environments, perhaps wireshare would be a good alternative. Happy to have helped.

Slicer321,

After, I turned “off” the security (ssl/tls via openfire’s admin interface) tcpdump’s output is decipherable. (plain ascii text).

Cool !!!. This is all beginning to make sense.

I have also been reading the rfc’s and they seem to concur. (rfc 3920, rfc 3921 )

Thanks again !!!

/rk