powered by Jive Software

MUC creation through REST API in a cluster

I’m trying to use Openfire as a base for my in-game user chat and I’ve run into some problems.

The setup is as follows: 2 CentOS VMs deployed on MS Azure in a virtual network with Openfire 3.10.2 servers, Hazelcast 2.1.2 and REST API plugin 1.1.7 installed.

The problem is - when I create a chat room through a REST call on server 1 - it shows up in the room list on server 2, but MUC settings are arbitrary defaults, instead of actual parameters set during creation, and none of the local users on server 2 can join the room (404 not found error is returned).

Rooms created via admin web-interface appear to function correctly.

Has anyone encountered errors like this? Is this a bug with REST plugin, or a problem with my network setup? Any help would be appreciated.

Did you tried it without the cluster? I mean could you please try it just on one instance and check if the settings will be applied.

If used without clustering, the REST plugin works correctly, verified both on local setup and in Azure.

Also, all the users connected to the node that is the REST endpoint seem to be able to use the MUC normally.

Could you please try to start both server in cluster mode and create a room over the REST API and restart both server afterwards and check if the settings are applied on both instances.

Yes, restarting both instances seem to disseminate the correct MUC settings.

If it works over the admin web interface in cluster mode, then its seems to be something wrong with REST API. But I don’t have any idea why, that need to be investigated.

1 Like

Do you know is there any possibility contact the plugin author, or if I should fall back to using standard XMPP protocols for MUC creation?

I’m the author of the REST API plugin. I could take a look today, if I can find something. My problem is, that I don’t have a cluster to test.

Unfortunately I can’t give access to my cluster setup, because it’s a corporate property, but there’s a 1-year trial of AWS you can use to create the setup, and I can help to set up the VMs, should you need a hand.

Alternatively, we can connect on Skype or something and you can talk me through building from sources and debugging it.

In any case, thx for the help!

1 Like

I ran into the same issue and I’m testing a fix

I have same issue. Is there any solution ? Thks.

I thought this issue was resolved with current releases of Openfire and the Rest API plugin. For example: https://issues.igniterealtime.org/browse/OF-1535

Yes, the Jira and patch resolved the issue for me .
What versions of Openfire and the rest api are you using, @gonzalo?

I’m using Openfire 4.2.3 and Rest API plugin 1.3.5 . Is this OK ? Thanks for fast answer!
Regards.

That’s the most recent version of each.
Have you confirmed that the clustering is enabled and the servers can see each other?

Have you turned on debug level logging to watch traffic between the cluster ?
Any errors in the logs on any of the instances in the cluster?

The REST API does have code which upon a rest call to create a room and clustering is in a state of started, it sends 2 cluster events

  1. RoomAvailableEvent
  2. RoomUpdatedEvent

https://github.com/igniterealtime/Openfire/blob/master/src/plugins/restAPI/src/java/org/jivesoftware/openfire/plugin/rest/controller/MUCRoomController.java#L310

Below is a screenshot of a system with clustering enabled and three nodes in the cluster.