How often does openfire check mucRoom for rooms

Currently, I am trying to write a room directly to the mucRoom table of the database, but the room does not always immediately appear in the openfire admin console.

Only after attempting to create the room in the openfire admin console does the server realize that there is already a room with that name on the server and then it appears and works normally from that point on.

So, how often does openfire actually check mucRoom to see if there is a room in the server? Also, how can I force it to do a refresh?

Cheers!

-Cthos

Hey Cthos,

I would recommend not going directly to the DB. Openfire caches a lot of information for performance reasons so making DB changes means that you might need to restart the server. In the case of MUC rooms, the MUC service does not poll for DB changes. It just loads persistent rooms from the DB when starting up and, as you noticed, also when someone tries to join a room. For performance reasons, Openfire does not load all persistent rooms in memory unless they have been recently used. However, since unloaded rooms still exist the MUC service will check in the DB if the room exists even if its not in memory. That is the reason why joining a room that only exists in the DB results in the room being loaded.

Having said all that, I would recommend writing a plugin that will create rooms by using the API or use Smack to simulate a client creating rooms. If you still need to go directly to the DB then you have two options. Option 1: Restart the server or option 2: load the room from a client for each new room created in the DB.

Regards,

– Gato