Project

General

Profile

Send AdHoc command to a specific entity

Martxel Lasa
Added about 4 years ago

Hi!

I'm using the Tigase XMPP server version 7.0.0 with the HTTP API.

I can send AdHoc commands to the session manager without issues, but I want to be able to send commands to specific clients too.

I have modified the rest/adhoc/AdHoc.groovy script and changed the regex to allow the resource part of the JID (from \/(?:([^@\/]+)@){0,1}([^@\/]+)/ to @/\/(?:([@\/]+)@){0,1}([@]+)/)@.

After doing that, I can send a GET request like: GET http://localhost:8080/rest/adhoc/example-client@localhost/client and the example-client@localhost/client successfully receives the iq request:

xmpp DEBUG RECV: <iq id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get" to="example-client@localhost/client" from="admin@localhost"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>

And responds with:

conn DEBUG SENT: <iq id="923759dc-8d49-478e-bcd2-3fb8380a9900" to="admin@localhost" type="result"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"><item jid="example-client@localhost/client" name="example name" node="example-node" group="Examples"/></query></iq>

But this response never gets back to the HTTP client, and the GET request just hangs.

This is the relevant (I think) part of the logs:

2015-03-03 12:51:37.751 [in_2-message-router]  MessageRouter.processPacket()  FINEST:   Processing packet: from=http@localhost/df9b7f5a-6f13-453b-9eb0-6ef4830f51ab, to=null, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=ADMIN, TYPE=get
2015-03-03 12:51:37.753 [in_2-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : example-client@localhost/client
2015-03-03 12:51:37.753 [in_2-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): example-client@localhost/client, for map: [amp@localhost, basic-conf@localhost, monitor@localhost, http@localhost, c2s@localhost, stats@localhost, sess-man@localhost, ws2s@localhost, vhost-man@localhost, s2s@localhost, bosh@localhost, pubsub@localhost]; trying VHost lookup
2015-03-03 12:51:37.754 [in_2-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): example-client@localhost/client, for map: [c2s, basic-conf, s2s, bosh, vhost-man, sess-man, ws2s, message-router, stats, pubsub, amp, monitor, http], for all VHosts: [localhost, localhost]; trying other forms of addressing
2015-03-03 12:51:37.754 [in_2-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : example-client@localhost/client
2015-03-03 12:51:37.755 [in_2-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): example-client@localhost/client, for map: [amp@localhost, basic-conf@localhost, monitor@localhost, http@localhost, c2s@localhost, stats@localhost, sess-man@localhost, ws2s@localhost, vhost-man@localhost, s2s@localhost, bosh@localhost, pubsub@localhost]; trying VHost lookup
2015-03-03 12:51:37.755 [in_2-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): example-client@localhost/client, for map: [c2s, basic-conf, s2s, bosh, vhost-man, sess-man, ws2s, message-router, stats, pubsub, amp, monitor, http], for all VHosts: [localhost, localhost]; trying other forms of addressing
2015-03-03 12:51:37.755 [in_2-message-router]  MessageRouter.processPacket()  FINEST:   2. Packet will be processed by: sess-man@localhost, from=http@localhost/df9b7f5a-6f13-453b-9eb0-6ef4830f51ab, to=null, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=ADMIN, TYPE=get
2015-03-03 12:51:37.756 [in_58-sess-man]   SessionManager.processPacket()     FINEST:   Received packet: from=http@localhost/df9b7f5a-6f13-453b-9eb0-6ef4830f51ab, to=null, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=ADMIN, TYPE=get
2015-03-03 12:51:37.756 [in_58-sess-man]   SessionManager.getXMPPResourceConnection()  FINEST: Searching for resource connection for: example-client@localhost/client
2015-03-03 12:51:37.757 [in_58-sess-man]   SessionManager.getResourceConnection()  FINEST: Session not null, searching session for jid: example-client@localhost/client
2015-03-03 12:51:37.757 [in_58-sess-man]   SessionManager.getResourceConnection()  FINEST: Found session: XMPPResourceConnection=[user_jid=example-client@localhost/client, packets=9, connectioId=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, domain=localhost, authState=AUTHORIZED, isAnon=false, isTmp=false], for jid: example-client@localhost/client
2015-03-03 12:51:37.757 [in_58-sess-man]   SessionManager.processPacket()     FINEST:   processing packet: from=http@localhost/df9b7f5a-6f13-453b-9eb0-6ef4830f51ab, to=sess-man@localhost, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=ADMIN, TYPE=get, connection: XMPPResourceConnection=[user_jid=example-client@localhost/client, packets=9, connectioId=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, domain=localhost, authState=AUTHORIZED, isAnon=false, isTmp=false]
2015-03-03 12:51:37.757 [in_58-sess-man]   SessionManager.walk()              FINEST:   XMPPProcessorIfc: ServiceDiscovery (disco)Request: from=http@localhost/df9b7f5a-6f13-453b-9eb0-6ef4830f51ab, to=sess-man@localhost, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=ADMIN, TYPE=get, conn: XMPPResourceConnection=[user_jid=example-client@localhost/client, packets=10, connectioId=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, domain=localhost, authState=AUTHORIZED, isAnon=false, isTmp=false]
2015-03-03 12:51:37.758 [in_58-sess-man]   SessionManager.processPacket()     FINEST:   Packet processed by: [disco]
2015-03-03 12:51:37.758 [in_7-message-router]  MessageRouter.processPacket()  FINEST:   Processing packet: from=sess-man@localhost, to=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=get
2015-03-03 12:51:37.761 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : example-client@localhost/client
2015-03-03 12:51:37.761 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): example-client@localhost/client, for map: [amp@localhost, basic-conf@localhost, monitor@localhost, http@localhost, c2s@localhost, stats@localhost, sess-man@localhost, ws2s@localhost, vhost-man@localhost, s2s@localhost, bosh@localhost, pubsub@localhost]; trying VHost lookup
2015-03-03 12:51:37.761 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): example-client@localhost/client, for map: [c2s, basic-conf, s2s, bosh, vhost-man, sess-man, ws2s, message-router, stats, pubsub, amp, monitor, http], for all VHosts: [localhost, localhost]; trying other forms of addressing
2015-03-03 12:51:37.762 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : c2s@localhost/127.0.0.1_5222_127.0.0.1_38522
2015-03-03 12:51:37.762 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, for map: [amp@localhost, basic-conf@localhost, monitor@localhost, http@localhost, c2s@localhost, stats@localhost, sess-man@localhost, ws2s@localhost, vhost-man@localhost, s2s@localhost, bosh@localhost, pubsub@localhost]; trying VHost lookup
2015-03-03 12:51:37.762 [in_7-message-router]  MessageRouter.processPacket()  FINEST:   1. Packet will be processed by: c2s@localhost, from=sess-man@localhost, to=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=get
2015-03-03 12:51:37.763 [in_7-c2s]         ClientConnectionManager.processPacket()  FINEST: Processing packet: from=sess-man@localhost, to=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=get
2015-03-03 12:51:37.763 [in_7-c2s]         ConnectionManager.writePacketToSocket()  FINEST: c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, type: accept, Socket: TLS: c2s@localhost/127.0.0.1_5222_127.0.0.1_38522 Socket[addr=/127.0.0.1,port=38522,localport=5222], jid: example-client@localhost/client, Writing packet: from=sess-man@localhost, to=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, DATA=<iq from="admin@localhost" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900" type="get"><query xmlns="http://jabber.org/protocol/disco#items" node="http://jabber.org/protocol/commands"/></iq>, SIZE=236, XMLNS=null, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=get
2015-03-03 12:51:37.765 [pool-14-thread-12]  ClientConnectionManager.processSocketData()  FINEST: Processing socket data: from=null, to=null, DATA=<iq type="result" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=309, XMLNS=null, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=result from connection: c2s@localhost/127.0.0.1_5222_127.0.0.1_38522
2015-03-03 12:51:37.765 [pool-14-thread-12]  ClientConnectionManager.processSocketData()  FINEST: XMLNS set for packet: from=null, to=null, DATA=<iq type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=331, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=result from connection: c2s@localhost/127.0.0.1_5222_127.0.0.1_38522
2015-03-03 12:51:37.765 [in_7-message-router]  MessageRouter.processPacket()  FINEST:   Processing packet: from=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, to=sess-man@localhost, DATA=<iq type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=331, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=result
2015-03-03 12:51:37.766 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : admin@localhost
2015-03-03 12:51:37.766 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): admin@localhost, for map: [amp@localhost, basic-conf@localhost, monitor@localhost, http@localhost, c2s@localhost, stats@localhost, sess-man@localhost, ws2s@localhost, vhost-man@localhost, s2s@localhost, bosh@localhost, pubsub@localhost]; trying VHost lookup
2015-03-03 12:51:37.766 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): admin@localhost, for map: [c2s, basic-conf, s2s, bosh, vhost-man, sess-man, ws2s, message-router, stats, pubsub, amp, monitor, http], for all VHosts: [localhost, localhost]; trying other forms of addressing
2015-03-03 12:51:37.766 [in_7-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : sess-man@localhost
2015-03-03 12:51:37.766 [in_7-message-router]  MessageRouter.processPacket()  FINEST:   1. Packet will be processed by: sess-man@localhost, from=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, to=sess-man@localhost, DATA=<iq type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=331, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=result
2015-03-03 12:51:37.767 [in_55-sess-man]   SessionManager.processPacket()     FINEST:   Received packet: from=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, to=sess-man@localhost, DATA=<iq type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=331, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=result
2015-03-03 12:51:37.767 [in_55-sess-man]   SessionManager.processPacket()     FINEST:   processing packet: from=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, to=sess-man@localhost, DATA=<iq type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=331, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=result, connection: XMPPResourceConnection=[user_jid=example-client@localhost/client, packets=10, connectioId=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, domain=localhost, authState=AUTHORIZED, isAnon=false, isTmp=false]
2015-03-03 12:51:37.768 [in_55-sess-man]   SessionManager.walk()              FINEST:   XMPPProcessorIfc: ServiceDiscovery (disco)Request: from=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, to=sess-man@localhost, DATA=<iq from="example-client@localhost/client" type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=374, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=result, conn: XMPPResourceConnection=[user_jid=example-client@localhost/client, packets=11, connectioId=c2s@localhost/127.0.0.1_5222_127.0.0.1_38522, domain=localhost, authState=AUTHORIZED, isAnon=false, isTmp=false]
2015-03-03 12:51:37.769 [in_55-sess-man]   SessionManager.processPacket()     FINEST:   Packet processed by: [disco]
2015-03-03 12:51:37.769 [in_14-message-router]  MessageRouter.processPacket()  FINEST:  Processing packet: from=sess-man@localhost, to=null, DATA=<iq from="example-client@localhost/client" type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=374, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=result
2015-03-03 12:51:37.769 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : admin@localhost
2015-03-03 12:51:37.769 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): admin@localhost, for map: [amp@localhost, basic-conf@localhost, monitor@localhost, http@localhost, c2s@localhost, stats@localhost, sess-man@localhost, ws2s@localhost, vhost-man@localhost, s2s@localhost, bosh@localhost, pubsub@localhost]; trying VHost lookup
2015-03-03 12:51:37.769 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): admin@localhost, for map: [c2s, basic-conf, s2s, bosh, vhost-man, sess-man, ws2s, message-router, stats, pubsub, amp, monitor, http], for all VHosts: [localhost, localhost]; trying other forms of addressing
2015-03-03 12:51:37.769 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: Called for : admin@localhost
2015-03-03 12:51:37.769 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No componentID matches (fast lookup against exact address): admin@localhost, for map: [amp@localhost, basic-conf@localhost, monitor@localhost, http@localhost, c2s@localhost, stats@localhost, sess-man@localhost, ws2s@localhost, vhost-man@localhost, s2s@localhost, bosh@localhost, pubsub@localhost]; trying VHost lookup
2015-03-03 12:51:37.770 [in_14-message-router]  MessageRouter.getLocalComponent()  FINEST: No component name matches (VHost lookup against component name): admin@localhost, for map: [c2s, basic-conf, s2s, bosh, vhost-man, sess-man, ws2s, message-router, stats, pubsub, amp, monitor, http], for all VHosts: [localhost, localhost]; trying other forms of addressing
2015-03-03 12:51:37.770 [in_14-message-router]  MessageRouter.processPacket()  FINEST:  2. Packet will be processed by: sess-man@localhost, from=sess-man@localhost, to=null, DATA=<iq from="example-client@localhost/client" type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=374, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=result
2015-03-03 12:51:37.770 [in_46-sess-man]   SessionManager.processPacket()     FINEST:   Received packet: from=sess-man@localhost, to=null, DATA=<iq from="example-client@localhost/client" type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=374, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=result
2015-03-03 12:51:37.770 [in_46-sess-man]   SessionManager.getXMPPResourceConnection()  FINEST: Searching for resource connection for: admin@localhost
2015-03-03 12:51:37.770 [in_46-sess-man]   SessionManager.processPacket()     FINEST:   processing packet: from=sess-man@localhost, to=sess-man@localhost, DATA=<iq from="example-client@localhost/client" type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=374, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=result, connection: null
2015-03-03 12:51:37.771 [in_46-sess-man]   SessionManager.walk()              FINEST:   XMPPProcessorIfc: ServiceDiscovery (disco)Request: from=sess-man@localhost, to=sess-man@localhost, DATA=<iq from="example-client@localhost/client" type="result" xmlns="jabber:client" to="admin@localhost" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query></iq>, SIZE=374, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=result, conn: null
2015-03-03 12:51:37.771 [in_46-sess-man]   SessionManager.processPacket()     FINEST:   Packet processed by: [disco]
2015-03-03 12:51:37.771 [in_2-message-router]  MessageRouter.processPacket()  FINEST:   Processing packet: from=sess-man@localhost, to=sess-man@localhost, DATA=<iq from="admin@localhost" type="error" xmlns="jabber:client" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query><error type="wait" code="404"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">The target is unavailable at this time.</text></error></iq>, SIZE=589, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error
2015-03-03 12:51:37.772 [in_2-message-router]  MessageRouter.processPacket()  FINEST:   Possible infinite loop, dropping packet: from=sess-man@localhost, to=sess-man@localhost, DATA=<iq from="admin@localhost" type="error" xmlns="jabber:client" to="example-client@localhost/client" id="923759dc-8d49-478e-bcd2-3fb8380a9900"><query node="http://jabber.org/protocol/commands" xmlns="http://jabber.org/protocol/disco#items"><item node="example-node" name="example name" jid="example-client@localhost/client" group="Examples"/></query><error type="wait" code="404"><recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">The target is unavailable at this time.</text></error></iq>, SIZE=589, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error

Am I doing something wrong? Any help would be very appreciated.

Thanks!


Replies (2)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 4 years ago

This AdHoc command handler in HTTP API was only considered as a way to execute adhoc commands on particular components. Due to this fact there is an issue with routing of packets when they are sent back from user connection which was not considered as an issue as it will never happen in case of execution of adhoc command on server components.

This issue with routing is caused by the fact that AdHoc command handler in HTTP API sends packet to jid which you pass in URL but also sets from attribute of a packet to bare jid of user which was passed during authentication needed by HTTP API. This way result packet is delivered to HTTP API component but is sent to SessionManager and processed there.

Added by Martxel Lasa about 4 years ago

Thank you for your reply.

I might end up bulding my own HTTP API and send the adhoc commands through XMPP, using jaxmpp.

    (1-2/2)