powered by Jive Software

Openfire with Connection Manager

We are using openfire with two connection manager acting as a reverse proxy. When we connect our client to openfire directly, the client connects very fast (0 sec). However when we connect using the connection mnager, it seems that the connection takes a very long time (15 seconds). I am using the default configuration of manager.xml. I have tried to tune the parameters but it makes little difference. We’re using jabber.net and our server is commserver resolved using DNS. Any help to resolve this will be greatly appreciated. After this step, the communication is relatively stable.

Below are the stack trace -

Sign in through Connection Manager
SEND at 6:09:31 PM :<stream:stream xmlns:stream=“http://etherx.jabber.org/streams” id=“227785bf” xmlns=“jabber:client” to=“commserver” version=“1.0”>
RECV at 6:09:31 PM :<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“172.24.58.9” id=“5qva574220a90” xml:lang=“en” version=“1.0”>
RECV at 6:09:31 PM :stream:featuresPLAINANONYMOUS</stream:features>
SEND at 6:09:31 PM :AGNzdXNlcjMAcEBzc3cwcmQ=

===> There is a delay of 15 seconds here looking at the time stamp

RECV at 6:09:46 PM :
SEND at 6:09:46 PM :<stream:stream xmlns:stream=“http://etherx.jabber.org/streams” id=“864f64a2” xmlns=“jabber:client” to=“commserver” version=“1.0”>
RECV at 6:09:46 PM :<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“172.24.58.9” id=“5qva574220a90” xml:lang=“en” version=“1.0”>stream:features</stream:features>

The same code connecting directly

**Sign in to App Server **

SEND at 6:08:21 PM :<stream:stream xmlns:stream=“http://etherx.jabber.org/streams” id=“33ecec41” xmlns=“jabber:client” to=“commserver” version=“1.0”>

RECV at 6:08:21 PM :<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“mqcommunicator” id=“e07b621a” xml:lang=“en” version=“1.0”>

RECV at 6:08:21 PM :stream:featuresPLAINANONYMOUSzlib</stream:features>

SEND at 6:08:21 PM :AGNzdXNlcjMAcEBzc3cwcmQ=

RECV at 6:08:21 PM :

SEND at 6:08:21 PM :<stream:stream xmlns:stream=“http://etherx.jabber.org/streams” id=“94b9638d” xmlns=“jabber:client” to=“commserver” version=“1.0”>

RECV at 6:08:21 PM :<?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=“http://etherx.jabber.org/streams” xmlns=“jabber:client” from=“mqcommunicator” id=“e07b621a” xml:lang=“en” version=“1.0”>stream:featureszlib</stream:features>

Can you enable debug logs? Is there anything in error/warn logs on the cmanagerd end? I also would perhaps explicitly put in the IP address of the Openfire server as a test, rather than relying on DNS to do the work.

You can enable debug on cmanagerd by changing this part at the end of manager.xml:

true

Hi,

This is a follow up on our actions and the solution that worked for us.

We tried the connection manager 3.6.3 on installations where there is firewall and load balancers and anti-virus software installed and also on installations in whcih these were absent. We found that some of those environments with firewall and load balancers (2 sites), seem to face this problem, but the setup in our office and the user test environment did not face this problem.

I turned on the debug and could not see much information. I then modified the codes to start logging every single transaction from client to CM and CM to server and vice-versa. What i discovered was that fort hat one paclet

AGNzdXNlcjMAcEBzc3cwcmQ=

The client to CM was fast, from CM to openfire was also fast - at least from the code perspective, but openfire took 15 seconds to return back to the CM.

The solution next was we started to use the older versions of connection managers - starting from 3.0.0. This worked well all the way until 3.5.1. Version 3.5.2 has this problem the exact same problem descibed above.

So we rolled back our version from 3.6.3 to 3.5.1.

Upon inspecting, we see that from 3.5.1 to 3.5.2, the jetty and mina jar files were changed and also this code in

ConnectionWorkerThread. We suspect it is the jetty and mina files but am not very sure. We have not had time to really troubleshoot this. Not sure what exactly causes openfire to respond with a 15 second delay between these two versions.

3.5.1

public void clientSessionCreated(String streamID) {

StringBuilder sb = new StringBuilder(100);

sb.append("<iq type=‘set’ to=’").append(serverName);

sb.append("’ from=’").append(jidAddress);

sb.append("’ id=’").append(String.valueOf(random.nextInt(1000) + “-” + sequence++));

    sb.append("'><session xmlns='[http://jabber.org/protocol/connectionmanager](http://jabber.org/protocol/connectionmanager)' id='").append(streamID);

sb.append("’>");

// Forward the notification to the server

connection.deliver(sb.toString());

}

3.5.2 onwards

public void clientSessionCreated(String streamID, InetAddress address) {

StringBuilder sb = new StringBuilder(100);

sb.append("<iq type=‘set’ to=’").append(serverName);

sb.append("’ from=’").append(jidAddress);

sb.append("’ id=’").append(String.valueOf(random.nextInt(1000) + “-” + sequence++));

    sb.append("'><session xmlns='[http://jabber.org/protocol/connectionmanager](http://jabber.org/protocol/connectionmanager)' id='").append(streamID);

sb.append("’><host name=’").append(address.getHostName());

sb.append("’ address=’").append(address.getHostAddress()).append("’/>");

// Forward the notification to the server

connection.deliver(sb.toString());

}

For those who are experiencing the same problems, one solution is to revert back to version 3.5.1

Hope this helps. Anyone who can shed any further light on this is most welcome.