我使用Openfire与Converse.js建立http绑定。 我想预先绑定它以便在我的webapp上进行单个会话。我使用了java librarie smack-bosh。
我成功登录(并保持记录),直接与openfire交谈(聊天,添加联系人,加入会议室......) 我也成功登录到了openfire并保持登录状态。 我成功地将Jid,Sid,Rid取回预先绑定。我预先绑定并使用converse.js登录,但由于过度活跃而导致我断开连接。 我在OpenFire中将xmpp.httpbind.client.requests.ignoreOveractivity设置为true,如上所述here。 过度活动是固定的。
如果我什么都不做,我会留下来。 但是一旦我尝试发送消息或添加联系人或更改状态,OpenFire就会断开会话。 在OpenFire日志中,如果我很清楚,那是因为会话显然是“不可用的”#34;但实际上converse仍然是连接的,因为尝试发出请求并收到一个"无效的SID"错误。
OpenFire日志:
2014.08.22 17:26:05 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: 3 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence id="3bP9K-37" from="test@127.0.0.1/fdf7cf75" to="test@127.0.0.1/fdf7cf75"/> rid: 891999928666552
2014.08.22 17:26:05 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: 3 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence from="test@127.0.0.1/fdf7cf75">
<show>dnd</show>
</presence> rid: 891999928666553
2014.08.22 17:26:05 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: 3 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence from="test@127.0.0.1/fdf7cf75">
<show>dnd</show>
</presence> rid: 891999928666554
2014.08.22 17:26:09 org.jivesoftware.openfire.http.HttpSession - consumeResponse: org.jivesoftware.openfire.http.HttpSession@e8ecbb status: -1 address: test@127.0.0.1/fdf7cf75 id: fdf7cf75 presence:
<presence type="unavailable" from="test@127.0.0.1/fdf7cf75"/> rid: 891999928666554
converse logs:
0 request id 3.0 posting converse.min.js:223
0 request id 3.0 state changed to 1 converse.min.js:223
<body rid="891999928666554" xmlns="http://jabber.org/protocol/httpbind" sid="fdf7cf75"> </body> converse.min.js:223
0 request id 3.1 state changed to 2 converse.min.js:223
0 request id 3.1 state changed to 3 converse.min.js:223
0 request id 3.1 state changed to 4 converse.min.js:223
0 removing request converse.min.js:223
0 _throttledRequestHandler called with 0 requests converse.min.js:223
0 request id 3 should now be removed converse.min.js:223
0 request id 3.1 got 200 converse.min.js:223
1 _dataRecv called converse.min.js:223
<body xmlns="http://jabber.org/protocol/httpbind"></body> converse.min.js:223
1 no requests during idle cycle, sending blank request converse.min.js:223
0 request id 4.0 posting converse.min.js:223
0 request id 4.0 state changed to 1 converse.min.js:223
<body rid="891999928666555" xmlns="http://jabber.org/protocol/httpbind" sid="fdf7cf75"></body> converse.min.js:223
POST http://127.0.0.1:7070/http-bind/ 404 (Invalid SID.) converse.min.js:223
l converse.min.js:223
Strophe.Bosh._processRequest converse.min.js:223
Strophe.Bosh._throttledRequestHandler converse.min.js:223
Strophe.Bosh._sendTerminate converse.min.js:223
Strophe.Bosh._disconnect converse.min.js:223
t.Connection.disconnect converse.min.js:223
t.Connection._dataRecv converse.min.js:223
Strophe.Bosh._onRequestStateChange
0 request id 4.1 state changed to 2 converse.min.js:223
0 request id 4.1 state changed to 3 converse.min.js:223
0 request id 4.1 state changed to 4 converse.min.js:223
0 removing request converse.min.js:223
0 _throttledRequestHandler called with 0 requests converse.min.js:223
0 request id 4 should now be removed converse.min.js:223
ERROR: request id 4.1 error 404 happened converse.min.js:223
2 request errored, status: 404, number of errors: 1 converse.min.js:223
1 _doDisconnect was called
Stanza记录:
<jive xmlns="http://www.jivesoftware.org">
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="connected" timestamp="août 22, 2014 06:05:26:873 PM"><iq xmlns="" id="3bP9K-42" type="set"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource/></bind></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:876 PM"><iq xmlns="" type="result" id="3bP9K-42" to="127.0.0.1/ec1f570e"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>test@127.0.0.1/ec1f570e</jid></bind></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:881 PM"><iq xmlns="" id="3bP9K-43" type="set" from="test@127.0.0.1/ec1f570e"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:881 PM"><iq xmlns="" type="result" id="3bP9K-43" to="test@127.0.0.1/ec1f570e"/></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:892 PM"><iq xmlns="" id="3bP9K-44" type="get" from="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:913 PM"><iq xmlns="" type="result" id="3bP9K-44" to="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:914 PM"><presence xmlns="" id="3bP9K-45" from="test@127.0.0.1/ec1f570e"/></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:26:915 PM"><presence xmlns="" id="3bP9K-45" from="test@127.0.0.1/ec1f570e" to="test@127.0.0.1/ec1f570e"/></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:27:078 PM"><iq xmlns="" type="get" id="1:roster" from="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>
<packet xmlns="http://www.jivesoftware.org" streamID="ec1f570e" status="auth" timestamp="août 22, 2014 06:05:27:078 PM"><iq xmlns="" type="result" id="1:roster" to="test@127.0.0.1/ec1f570e"><query xmlns="jabber:iq:roster"/></iq></packet>
感谢您的帮助。