So, I've tracked it down -- the default chunk size is a bit too low for certain MARCXML-heavy responses to be chunked properly. Consider a request like this:
The maximum chunk size is currently OSRF_MSG_CHUNK_SIZE == 2 * OSRF_MSG_BUNDLE_SIZE == 2 * 25600 == 51200, but that gets applied when splitting up the original payload as initially converted to JSON. If the payload is primarily XML and has a lot of quotes and brackets that end up getting escaped and converted to entities... I've seen chunks of 51200 bytes of payload ended up become XMPP messages larger than 66000 bytes.
So, I've tracked it down -- the default chunk size is a bit too low for certain MARCXML-heavy responses to be chunked properly. Consider a request like this:
open-ils.cstore open-ils. cstore. json_query {"from" :["unapi. biblio_ record_ entry_feed" ,"{234, 233,230, 235,223, 215,244, 212,221, 225}"," marcxml" ,"{holdings_ xml,mra, acp,acnp, acns,bmp, cbs}"," CONS"," 0","acn= >5,acp= >5",null, null,"1" ]}
The result will include a lot of XML containing quotes and brackets:
<datafield tag="028" ind1="3" ind2="0"><subfield code="a" >HL50498715. ..
which gets converted to JSON as part of the payload of an OpenSRF transport message:
<datafield tag=\"028\" ind1=\"3\" ind2=\" 0\"><subfield code="a" >HL50498715. ..
which, if too large, gets converted to JSON in chunks:
<datafield tag=\\\"028\\\" ind1=\\\"3\\\" ind2=\\ \"0\\\" ><subfield code="a" >HL50498715. ..
and converted to XML, and wrapped in an XMPP message, resulting in
<datafield tag=\\\ \\\\" 028\\\\ \\\" ind1=\\ \\\\\" 3\\\\\\ \" ind2=\\ \\\\\" 0\\\\\\ \" >< subfield code=\\ \\\\\" a\\\\\\ \" >HL50498715& lt;
The maximum chunk size is currently OSRF_MSG_CHUNK_SIZE == 2 * OSRF_MSG_ BUNDLE_ SIZE == 2 * 25600 == 51200, but that gets applied when splitting up the original payload as initially converted to JSON. If the payload is primarily XML and has a lot of quotes and brackets that end up getting escaped and converted to entities... I've seen chunks of 51200 bytes of payload ended up become XMPP messages larger than 66000 bytes.