powered by Jive Software

Potential Openfire Bug

I am not sure if this is a bug or if we are just doing something wrong.

I am working on developing an XMPP client for Android, using an Openfire server. Whenever the client tries to send a message to just a bare jid <‘local’@‘domain’> instead of just a full jid <‘local’@‘domain’/‘resource’>, the message ONLY goes to the last resource connected to the server, instead of broadcasting out to all resources of that account.

An example message stanza (domian and resource are real values, but ‘hidden’ here):

OF is broken?

In this case, the only connection that receives the message is the one that sent it. In the case where another account, say ‘original’, sends the above stanza (with the necessary bits replaced), ONLY the last connection made for account ‘other’ gets the message. If that connection is terminated, then the next to last connection will then begin receiving the messages.

From my understanding of the XMPP standard, any stanza sent to a bare jid should be broadcasted to all resources associated witht that jid.

So, is there a bug within Openfire? Are we breaking the stanza? Or is this behavior as expected?

Your understanding is partially correct. The behaviour, according to the spec (RFC 6121) is

If there is more than one resource with a non-negative presence

priority then the server MUST either (a) deliver the message to

the “most available” resource or resources (according to the

server’s implementation-specific algorithm, e.g., treating the

resource or resources with the highest presence priority as "most

available") or (b) deliver the message to all of the non-negative


The default behaviour you are seeing is an implementation of (a). To accomplish (b) you will have to set the property route.all-resources to true, but this will only deliver the messages to all clients with the same highest priority. I think there may have been a change in the spec somewhere as the current reading makes no mention of priority (except being non-negative).

So, if I set the property to true, and all resources have the same priority (1 in this case), the message should be broadcasted out to all resources?

Never mind rcollier. I made the changes, and it works now. Thanks for the help.