Details
Description
If a user is connected multiple times using the same priority in different clients the server will send the message (sent to bare JID of user) only to the client that last logged in (with highest priority). Instead we need to be smarter and even let admins override the default logic:
New smart logic:
1) Select resources with highest priority
2) Select resources with highest show value (e.g. available, away, xa)
3) Select resource with most recent activity
4) Send message to that resource
Admins can set the system property "route.all-resources" to true to override the above logic and just send the message to all connected resources with highest priority.
See: http://www.xmpp.org/specs/rfc3921.html#rules (Section 11.1.4.1.)
It would also be nice if you had an option to "deliver to a random server".
Even better would be if there were affinity. So, imagine that A B and C are all connected with the JID "foo@example.com". If "dombiak@jivesoftware.org" were to send a message to "foo@example.com", it might randomly select B as the place to send it. Then, future messages from dombiak to foo would keep going to B for as long as B is still online (or until the session cache times out).
That would allow load balancing for complex services.