Percona Multi-Master replication and Openfire

Hello I would like to know if a percona multi-master replication in three regions (servers) A, B et C will work with openfire ?

Basically, I would like to install three openfire servers in three regions (offices) sharing the same database that percona replicates over these these three servers or locations.

I would like to know if that would work and allow a user in office A on server A to chat with a second user locates in office B on server B as if they were on the same server.

I am planing on manually configure the database on two server by editing the file conf/openfire.xml

"

com.mysql.jdbc.Driver

jdbc:mysql://172.68.25.211:3306/openfire2?rewriteBatchedStat$

19e11dd4a2c68678fff69940d731b521695c437cf08887$

755368eabf6cc8af0e689d5ea330dedcb249d87fe7aa7c$

select 1 "

Is there a plugin or another approach to achieve this ?

Thanks.

It looks like the above approach is useless since openfire has a built in feature called " server-to-server" configuration where users form server A can add contact from server B and start a chat…

The only problem is that openfire 4.0.2 is unstable. I did follow this s2s tutorial https://community.igniterealtime.org/docs/DOC-1030. It worked but once the user is offline and reconnect after, the communication between the two users is lost.

Is there an old openfire version that is well known to provide a stable s2s connection without any issues ?