XMPP Question

Hello Everybody,

If two clients are logged in at the same time using the same username but different resources, e.g. user@localhost/resource1 and user@localhost/resource2, and another client sends a message packet to user@localhost/resource1, resource1 gets the message. However, if resource1 is not logged in, then resource2 gets the message even if the message to is addressed to user@localhost/resource1. Is this the expected behavior?

Thanks,

Oliver

Hi Oliver,

The situation that you are describing is correct according to the XMPP spec. This is the paragraph that explains what a server should do:

“if the JID is of the form <user@domain/resource> and no available resource matches the full JID, the recipient’'s server (a) SHOULD silently ignore the stanza (i.e., neither deliver it nor return an error) if it is a presence stanza, (b) MUST return a stanza error to the sender if it is an IQ stanza, and © SHOULD treat the stanza as if it were addressed to user@domain if it is a message stanza.”

Regards,

– Gato

Thanks Gato.

We were hoping to be able to use resources to differentiate a user role. In that sense, a user account can have one to many roles/resources and each role/resource is independent of the others. (message sending perspective) That way, there won’'t be an explosion of user accounts. Any advice?

Oliver

Hey Oliver,

I can think of two ways to achieve what you are looking for.

Option 1: Implement Advanced Message Processing

This extension allows you to send messages specifying that the exact resource should receive the message or otherwise do some defined action such as: drop the message, answer an error, etc…

Option 2: Implement Extended Stanza Addressing

You can implement this JEP, implement just the part that you need or copy the idea and implement your own plugin. In summary, in this option you will need to write a new plugin that provides a service for delivering messages to exact resources.

As always, another option is to change the initial proposal and instead of having an account with sub-accounts (i.e. many resources) you can try having a user account for each user.

Regards,

– Gato

Thanks Gato.

I’'ll do some research regarding the options that you gave.

Oliver

Hello Gato,

I read about JEP-0079 and I tried sending an IQ query with a disco#info to the Jive Messenger and AMP is not a feature that was listed by the messenger.

Does Jive Messenger support Advanced Message Processing?

Thanks.

Oliver

No, Jive Messenger doesn’‘t currently support advanced message processing. I’'ve added a feature request for this as: JM-127

Regards,

Matt

Thanks Matt