Search code examples
javaxmppopenfireinstant-messaging

XMPP:BOSH client session getting closed randomly while connecting to openfire


I get this message after sometime.

 org.jivesoftware.openfire.http.HttpSession - Request 3436024236568502 > 3436024236568501, ending session.

Basically I send around 1,00,000 messages/queue/hour each of 400 bytes. I see that only this session is terminated .

What does this message indicate and what s the possible solution?


Solution

  • You run into the following constraint

    else if (rid > (lastRequestID + maxRequests)) {
        Log.warn("Request " + rid + " > " + (lastRequestID + maxRequests) + ", ending session.");
            throw new HttpBindException("Unexpected RID error.",
                    BoshBindingError.itemNotFound);
    }
    

    Source

    Which means there are to many outstanding BOSH requests. Openfire defaults to 2. You could try to modify the Openfire settings xmpp.httpbind.client.requests.max, but I would not recommend doing so. Instead ensure that your BOSH client only sends new requests if there is no more then 1 outstanding one.