powered by Jive Software

Message to multiple clients will not work as expected with route.all-resources property

openfire

#1

Hi,

I am working on a environment which has inbuilt chat facility over openfire (v3.9.3), signalr and matrix. Where I want to support for same user for multiple sessions. For example user can log on to the chat on different locations (home, office, mobile etc …) .

But the above scenario I mentioned didn’t work as expected so I added route.all-resources property with the value of true. Then I can see a strange behavior, which is if I logged with UserA twice (Lets say UserA-1, UserA-2) and UserB once. And when I send message from UserB to UserA it should go to the both UserA instances (UserA-1, UserA-2).

But what I can see is same message repeating twice (duplicate) on UserA-1. Also lets assume if I have another user UserA-3 then, I can see same message 3 times (triplicate) on UserA-1.

How I can resolve this issue?

Note: I am creating xmppclient instances for user, we create for full JID (with resource appended) and when sending the TO field specified for bare JID (without the resource appended).

Thanks!


#2

I don’t see this issue using Openfire 4.2.0 Beta and sending a message from one Spark client to a contact with two sessions (both Spark). Both receive one message. So, either this is related to that other software you mentioned (signalr, matrix, not sure what they do). Or maybe your client is doing something weird (what client?). Or maybe this is a bug in 3.9.3, although i don’t remember such issue. So, maybe try updating (at least to 4.1.6) and see if you can still reproduce your issue. Or try doing this with 3 Spark clients to see if it works ok in that scenario.


#3

Thanks for your reply.
With the latest version of openfire also I am having the same behavior.

I will check with spark, meanwhile is it possible to open multiple sessions of spark on same machine?


#4

If you run them with different users (on Windows at least). But to make it a good test, you should run them on different machines or at least virtual machines. Though it should work on the same machine, but i would use different clients then. Say Pidgin, Spark and Psi.


#5

Thanks for reply.
I was able to test the scenario previously mentioned by 2 Pidgin clients (on two machines) and 1 Spark client.
Lets assume two Pidgin clients are UserA-1 and UserA-2 (Same UserA but with different resources) and Spark client is UserB.

When I send a message from UserB to UserA then both UserA-1 and UserA-2 got the message. Yes this is the expected behavior that I didn’t get with my custom program written with SignalR and Matrix.

So when UserA-1 send a message to UserB , UserB got the message and that is also fine. But I can’t see that message on UserA-2 history. Assume UserA-1 and UserA-2 and web and mobile clients. Then both clients should have the same history, Is this not the case with XMPP protocol ?

Thanks!


#6

Not out of the box usually. XMPP is rather old and was created when using multiple devices wasn’t a thing (long before Apple created iMessage or Google Talk appeared). There is a XEP “Message Carbons” for that though, but not many clients support it. Openfire server supports it, so you need a capable client (like Conversations, Gajim, etc.). You will have to add support for that to your custom client then. And even if you do, this will only work when both clients are online. If one of them is offline, it won’t get messages sent on another client to its history. It won’t store history centrally for every client to retrieve. Another option is Message Archive Management, but it is even more experimental and even less support exists for it. Explanation: message synchronization between clients