android - Using Smack to get rosters from ejabberd No response received within reply timeout -
our xmpp server using ejabberd. have 3 clients connect servers chat application. ios, android , web. web , ios can chat history server without problem.
however in android, failed fetch message history using smack. user able send message server on xmpp connection, it's jut not able receive message. it's timeout no matter how big set timeout. after timeout server return result.
please see code below on how implemented code loading chat history.
public void loadarchivemessages(jid jid, xmppwebsocketconnection xmpptcpconnection) { try { mammanager mammanager = mammanager.getinstancefor(xmpptcpconnection); mammanager.mamqueryresult mamqueryresult = mammanager.queryarchive(null, 2, null, null, jid, null); list<forwarded> forwardedmessages = mamqueryresult.forwardedmessages; iterator<forwarded> forwardediterator = forwardedmessages.iterator(); while (forwardediterator.hasnext()) { forwarded forwarded = forwardediterator.next(); stanza stanza = forwarded.getforwardedstanza(); if (stanza instanceof org.jivesoftware.smack.packet.message) { string messageid = stanza.getstanzaid(); connection.sendstanzainternal(stanza); } } } catch (xmppexception.xmpperrorexception e) { e.printstacktrace(); } catch (smackexception.notloggedinexception e) { e.printstacktrace(); } catch (smackexception.notconnectedexception e) { e.printstacktrace(); } catch (interruptedexception e) { e.printstacktrace(); } catch (smackexception.noresponseexception e) { e.printstacktrace(); } }
and exceptions got.
org.jivesoftware.smack.smackexception$noresponseexception: no response received within reply timeout. timeout 30000ms (~30s). waited response using: iqreplyfilter: iqandidfilter (andfilter: (orfilter: (iqtypefilter: type=error, iqtypefilter: type=result), stanzaidfilter: id=yxci3-31)), : fromfilter (orfilter: (frommatchesfilter (full): otsuka.tungdao.com)). 08-15 09:15:21.100 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smack.stanzacollector.nextresultorthrow(stanzacollector.java:253) 08-15 09:15:21.100 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smack.stanzacollector.nextresultorthrow(stanzacollector.java:208) 08-15 09:15:21.101 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smackx.disco.servicediscoverymanager.discoverinfo(servicediscoverymanager.java:540) 08-15 09:15:21.101 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smackx.disco.servicediscoverymanager.discoverinfo(servicediscoverymanager.java:506) 08-15 09:15:21.101 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smackx.disco.servicediscoverymanager.supportsfeatures(servicediscoverymanager.java:701) 08-15 09:15:21.101 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smackx.disco.servicediscoverymanager.serversupportsfeatures(servicediscoverymanager.java:678) 08-15 09:15:21.101 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smackx.disco.servicediscoverymanager.serversupportsfeatures(servicediscoverymanager.java:672) 08-15 09:15:21.102 28911-28945/com.otsuka.android w/system.err: @ org.jivesoftware.smackx.disco.servicediscoverymanager.serversupportsfeature(servicediscoverymanager.java:667)
we have tried search solutions no avail.
Comments
Post a Comment