How to redirect xmpp traffic to another openfire instance?

How can I redirect xmpp packets to another openfire server?

If my xmpp server received a packet from xmpp-client is there a way to resend it in such a way,

that another server (which is connected to first one via server-to-server connectivity) get it?

I’ve googled and tried to search in docs but I failed to find an answer, please give me a clue.

For what purpose?

This seems like an odd thing to do so maybe you would get some help if we better understood what you are trying to accomplish.

I want to create some kind of xmpp-proxy-server, that checks your JID and redirect all your packets to another server according to it. This is needed for load balancing - I don’t need the ability of any user to chat with any other user, all my users are divided into small isolated groups, and I need a single point of access for all the users.

This is what clustering was meant for.

Openfire already supports clustering via a plugin, although it is not a free solution as it requires a Coherence license.

There is also the Packet Filter Plugin which allows to keep separate groups separated by blocking communication between the groups.