Handle see-other-host in smack

Hello,

I’m trying to use smack in order to connect to Microsoft’s Xmpp Msn api. Last april they made a change in their implementation which forces clients to implement the “see-other-host” xmpp specification. When I try to connect to “xmpp.messenger.live.com” I get

stream:error (see-other-host)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:260)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)

I’m debugging and I can see the raw received packets

<stream:stream from=“messenger.live.com” version=“1.0” id=“59784” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams”>

<stream:features xmlns:stream=“http://etherx.jabber.org/streams”></stream:features>

<stream:stream from=“messenger.live.com” version=“1.0” id=“59785” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams”>

<stream:error xmlns:stream=“http://etherx.jabber.org/streams”>BY2MSG3020517.gateway.edge.messenge r.live.com</stream:error>

But I’m unable to find a way in order to intercept and handle that redirect.

Has anybody done this? Any help would be appreciated. Thanks.

1 Like

Same problem here.

If other Smack users or developers have questions about this, please direct them to the Live Connect forums here: http://social.msdn.microsoft.com/Forums/en-US/messengerconnect/threads

Thanks,

Bill

Logged as SMACK-386.

Hey Robin,

Glad to see this reported as a new feature.

However, do you know if there’s a workaround for this with the current version 3.2.2?

Like registering a ProdiverManager or something like that? Or maybe adding a patch inside the code itself?

We really need to connect to msn server and can’t seem to find a workaround.

Thanks for your help.

This is the first time I have seen this issue come up, so I am unfamiliar with it. I would suggest checking out some of the MSN forums and see if you can find anything useful there as was suggested by @Bill Garrett. Hopefully someone already has a solution for this, whether using standard Smack or a patch to fix the problem.

Background: The see-other-host stream error redirects a client to another server. In the case of Messenger, it’s intended to allow clients to cleanly switch to another server should their current server go out of service, or to connect to another server for load-balancing purposes.

Working with our sample Java code (which uses Smack), I find two problems: first, that registered connection listeners don’t receive notification of the exception (it only gets logged to the console), and second, that there’s no way to access the text element of a stream error from XMPPException.

Handling the redirection internally would be the friendliest solution, but notifying the client of the new server would at least allow clients to make a new connection without user intervention.

To date, I haven’t seen any proposed workarounds on the Live Connect forums.

Thanks,

Bill

1 Like

Good information Bill. That will add a lot to the JIRA task (which is already linked to this discussion).

Thanks.

1 Like