1
votes

Currently, the ejabberd server instance running for our app is not storing offline messages in mysql. Example : user 'foo' sends message to another user 'bar', in its roster. The message does not show up in archive table of mysql database, configured with ejabberd, until bar connects to ejabberd server.

This means the message from foo is stored in mnesia table until bar comes online, and then in mysql's archive table. I need to access this data before bar connects. Two ways: -

  • Access mnesia database and query the message. i am using play framework and am not sure how to access mnesia , without logging in from bar's account and accessing all messages
  • Store offline messages in mysql

Which way is better and how to achieve the same?

(assumption here is offline data is being stored in mnesia. I havent verified the same but online articles point to the same)

UPDATE

mod_offline was set to odbc only. What i just found out is that offline messages are stored in spool table until user connects to ejabberd, after which they are pushed to archive table

1

1 Answers

0
votes

In your ejabberd.yml (configuration file) set the following lines-

 mod_offline: 
    access_max_user_messages: max_user_offline_messages
    db_type: odbc

It work if ejabberd connected to mysql.ejabberd mysql connection configuration is here