Local MUC Room is not sync to a remote node correctly

I have a two-node clustered Openfire 4.2.3 started first and an external component having a client (“focus”) connecting to the senior node. The client creates a MUC room “jibribrewery” and updates the room with the owner/moderator occupant info. However, there are three fields (occupantsByFullJID, occupantsByBaredJID, occupantsByNickname) in LocalMUCRoom.java not serialized in the RoomUpdatedEvent, so the non-senior XMPP node does not populate the remote room completely. The Openfire console in the senior node shows the room having one occupant (the owner/moderator.) But in the non-senior node, the Openfire console shows the room with zero occupants (the maps in occupantsByFullJID, occupantsByBaredJID, occupantsByNickname are empty.)

If I started an XMPP node and the external component to create and join the room first, then having the 2nd node joins the cluster later, the room is populated with the occupant correctly. It seems that LocalMUCRoom.occupantAdded() was used and it did the right job.

Does anyone have any fix for this problem?

More update on this problem.

Turn out that the missing three fields in RoomUpdateEvent is not the root problem. The problem is a timing issue in the remote node. After the senior node sent out OccupantAddedEvent in LocalMUCRoom.joinRoom() and the client immediately updated the room which triggered a RoomUpdatedEvent, the remote node received OccupantAddedEvent, but it didn’t invoke LocalMUCRoom.occupantAdded(). Instead, the remote node processed the RoomUpdatedEvent and invoked LocalMUCRoom.updateConfiguration().

If I put some delay between OccupantAddedEvent and RoomUpdatedEvent, the remote node was able to invoke LocalMUCRoom.occupantAdded().

Have anyone encountered this problem?

I have the same problem… where did you put the delay exactly? do you have a code snipplet?

@totzkotz It turns out that there are two different bugs causing this problem. You can find my analysis in MUC events in Hazelcast plugin are out of order
Greg Thomas has a suggested fix which I haven’t tried. I am using my private fix which is slightly complicated but less blocking.