According to the XMPP spec (RFC 3921, section 11.1)
Note that RFC 3921 is obsoleted by RFC6121
But what is the default strategy of Openfire to select a resource to deliver to?
Quoting javadoc of openfire/spi/RoutingTableImpl.routeToBareJID:
Deliver the message sent to the bare JID of a local user to the best connected resource. If the target user is not online then messages will be stored offline according to the offline strategy. However, if the user is connected from only one resource then the message will be delivered to that resource. In the case that the user is connected from many resources the logic will be the following:
- Select resources with highest priority
- Select resources with highest show value (chat, available, away, xa, dnd)
- Select resource with most recent activity
The server would do some kind of load-balancing job.
Why not simply let the clients randomly select a resource and do so the load-balacning? This would come with the advantage that you don't depend on the server implementation and allow you to switch the server (more) easily.