Smack-4.1.0-beta2: Timeout on publish PayloadItem containing JSON

Problem

When publishing node.send(…), where PayloadItem contains JSON, the LeafNode’s send method throws org.jivesoftware.smack.SmackException$NoResponseException: No response received within packet reply timeout. Timeout was 5000ms (~5s).

I did try setPacketReplyTimeout(5000 * 10) but this just made waiting to get same exception longer.

Details

  • Node is a simple instant node, not using ConfigureForm.
  • Subscriber (not shown below) is on a different thread of control with different connection and he is waiting with a NodeConfigureListener handler…
  • jsonObject is ~ 5 megabyte and validates with JSONParser.parse
  • Using smack-4.1.0-beta2-SNAPSHOT-2015-01-14
  • Using ejabberd 14.12 community

//…

assertNotNull(con);

assertNotNull(jsonObject);

**// Create a pubsub manager using an existing connection that is valid** ```PubSubManager mgr = new PubSubManager(con); `

**// Get the node that was previously created** LeafNode node = mgr.getNode("testNode");

//Create JSON payload

JsonPacketExtension jasonPacketExtension = new JsonPacketExtension(jsonObject.toString());

PayloadItem payloadItem = new PayloadItem(jasonPacketExtension); // no client id, just let server create id

// Publish an Item with JSON payload

node.send(payloadItem); *** //<================ NoResponseException: No response received within packet reply timeout.***

Please set SmackConfiguration.DEBUG (DEBUG_ENABLED in some older revisions) to true and post the stanza trace.

  • jsonObject is ~ 5 megabyte and validates with JSONParser.parse

Note that the lower bound for the maximum stanza size the XMPP specs give is 10000 bytes. Although some (most?) implementations allow (far) bigger stanzas, have you tested node.send() with a smaller size?

  • no exception encountered, I will now test to determine json payload upper bound (in bytes) per adjacent discussion on this topic
    That’s no longer required the trace shows a (non-error) response (4XM9a-15). Now you need to debug why the packet collector created by LeafNode.send() does not collect the response. I suggest at least one breakpoint in IQReplyFilter (ideally after the collector has been created).