Is there any way to have multiple clients with the same ID connected simultaneously so that requests are sent out in either a round-robin fashion or, better yet, in a somewhat coherent fashion with respect to who is sending the message?
Specifcally, I want to run a back-end service. My service will connect to Jive Messagener just like any other client. People can then send messages to my service’‘s JID. My back-end service receives the messages, processes them, and sends a reply. The problem is, what happens if my server doesn’‘t scale (it’‘s processor intensive)? I’'d like to be able to connect multiple instances of my backend system and have Jive choose one to route it to. Choosing randomly would be ok, but trying to always assign the same user to the same server would make it easy to cache data.
I suspect the answer is no, but I figured I’‘d ask. If I ever get around to implementing it myself (which I may), I’‘d be glad to contribute it back, but since I don’'t know much about Jive, please also consider this a feature req.
The xmpp protocol specifies that you can connect with the same jid several times. The server decides then who has the highest priority for delivering messages. For sending the message he uses the ressource identifier like name@server/resource to deliver the message. you can change the priority with sending:
Thank you. I’'m actually asking about a slightly different use case:
I’'d like to connect two clients with the same JID and priority and have the messages split between them rather than sent to the one with the higher priority (or the most recent one with that priority).
Currently Messenger will send the message only to the client that last logged in. We are planning to add better support for this situation in future versions.
You will be able to configure your installation and decide which logic to use. Available logic options could be:
Deliver the message to the client with most recent connect time
Deliver the message to the client with most recent activity time
Deliver the message to the client with highest availability as determined by some hierarchy of values
Deliver the message to all the resources with same priority.
I see. So how does the Messenger manage routing messages between two resources right now? By priority right? If so, how do I set which resource has higher priority?
Btw, I’'m using a test client with smack and the other with Exodus.