Delay in message archiving for Monitoring Service plugin

Hi,

I am using the Monitoring service plugin to save one-to-one chats in the db (mysql). But i observe that there is some delay of about 20-30sec between the time when message is received and when it gets stored in the db. I cant find any settings for this in the Archive settings page of the admin console. May be openfire is using some internal caching or batching mechanism to store chunk of data at one. Is there any way to avoid this as I need to get the recent chat between two people as soon as any one of them refreshes the page.

Thanks

Hi Vineet,

You are correct in that the monitoring plugin uses a queue to temporarily store messages/conversations which then in turn uses a batching mechanism to save the messages to the database. By default, the messages are saved to the database once a minute so that’s partially* why you are seeing the delay. The only way to reduce the delay would be to change the source to the plugin and then build it yourself, but making such a change could significantly affect Openfire’s performance especially if there are a lot of messages being sent between users.

What is the reason for needing to know immediately when a conversation starts?

Thanks,

Ryan

  • The conversations viewer is set to refresh every ten seconds, so you would also need to change it’s delay if you were to decease the delay at which messages are saved to the database.

Hi Ryan.

Thanks for the reply. This app requires that while the users are chatting, and if they navigate to some other page then the state of the chat is to be maintained ie. the chat window stays open and shows the recent conversation. And it takes only about 10 secs to refresh . Thats why the delay is undesirable.

If the source needs to be changed then it looks pretty difficult for me with beginner level java skills. Is there any other way or plugin to store the messages manually or something ?

Thanks

Hi Vineet,

Unfortunately I am not aware of any other solutions that will meet your specific needs. Probably the best thing for you to do would be to read the Plugin Developer Guide (and search this site) to learn how to build Openfire/plugins and then make the changes to the monitoring plugin yourself. But, just to reiterate again what I said before, depending on the number of messages you expect to be handling you could run into performance issues if both Openfire and your application are making a lot of calls to your database.

I hope that helps,

Ryan

Hi guys,

I am also facing same problem. I am not a java developer so i don’t know where can i change code for reduce delayed time. Please help me on this

thank you in advance