当收件人离线并上线时,我收到以下错误消息。我希望接收者能够收到离线消息,但似乎有些不对劲。
2015-11-07 19:25:16.583 [debug] <0.748.0>@ejabberd_c2s:send_text:1892 Send XML on stream = <<"<message from='+999999@abc.example.com' to='+888888@abc.example.com/+888888' type='error' xml:lang='en' id='uGWtv-18'>
<body>gwtnwf </body><thread>608802ea-265e-4ec4-a39a-408fd75dc268</thread>
<x xmlns='jabber:x:oob'><file1url>1446904491592252000.jpeg</file1url><postuuid>8a660e7f-d0a1-4f0c-9c87-f8c4f30436a5</postuuid><from>+999999</from></x>
<error code='503' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></message>">>
下面的是在出现上述错误之前的ejabberd日志:
2015-11-07 19:38:49.480 [debug] <0.681.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='5m6LdO+13BLJZeS37oD5PF54bGY='/><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/><sm xmlns='urn:xmpp:sm:2'/><sm xmlns='urn:xmpp:sm:3'/><csi xmlns='urn:xmpp:csi:0'/></stream:features>">>
2015-11-07 19:38:49.631 [debug] <0.680.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<iq id='UPu2R-4' type='set'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>+888888</resource></bind></iq>">>
2015-11-07 19:38:49.631 [debug] <0.680.0>@shaper:update:120 State: {maxrate,1000,0.0,1446905329479460}, Size=121 M=60.5, I=152.0
2015-11-07 19:38:49.631 [debug] <0.681.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<iq id='UPu2R-4' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>+888888@abc.example.com/+888888</jid></bind></iq>">>
2015-11-07 19:38:49.651 [debug] <0.680.0>@ejabberd_receiver:process_data:349 Received XML on stream = <<"<iq id='UPu2R-6' type='set'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>">>
2015-11-07 19:38:49.651 [debug] <0.680.0>@shaper:update:120 State: {maxrate,1000,397.55813877078964,1446905329631639}, Size=87 M=54.29214132814999, I=19.649
2015-11-07 19:38:49.651 [info] <0.681.0>@ejabberd_c2s:wait_for_session:1120 ({socket_state,gen_tcp,#Port<0.7185>,<0.680.0>}) Opened session for +888888@abc.example.com/+888888
2015-11-07 19:38:49.651 [debug] <0.681.0>@ejabberd_c2s:send_text:1901 Send XML on stream = <<"<iq type='result' id='UPu2R-6'/>">>
2015-11-07 19:38:49.652 [debug] <0.666.0>@ejabberd_c2s:send_element:1905 Cannot send element while waiting for resumption: {xmlel,<<"stream:error">>,[],[{xmlel,<<"conflict">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-streams">>}],[{xmlcdata,<<>>}]},{xmlel,<<"text">>,[{<<"xml:lang">>,<<"en">>},{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-streams">>}],[{xmlcdata,<<"Replaced by new connection">>}]}]}
2015-11-07 19:38:49.652 [debug] <0.666.0>@ejabberd_c2s:send_trailer:1968 Cannot send stream trailer while waiting for resumption
2015-11-07 19:38:49.652 [info] <0.666.0>@ejabberd_c2s:terminate:1822 ({socket_state,gen_tcp,#Port<0.7173>,<0.665.0>}) Replaced session for +888888@abc.example.com/+888888
2015-11-07 19:38:49.653 [debug] <0.666.0>@mod_carboncopy:disable:249 disabling for <<"+888888">>
2015-11-07 19:38:49.653 [debug] <0.666.0>@mod_shared_roster:unset_presence:1104 unset_presence for <<"+888888">> @ <<"abc.example.com">> / <<"+888888">> -> <<"Replaced by new connection">> (1 resources)
下面是我的ejabberd配置
max_user_offline_messages:
admin: 5000
all: 1000
这是我用smack 4.1.2连接的方式
connection = new XMPPTCPConnection(getConnectionConfiguration(userName,password));
connection.setUseStreamManagement(true);
connection.connect();
connection.login(userName, password);