KB Article #176703

Large transactions are truncated and fail with an error saying "max read/write len reached"

Problem

Large transactions show a truncated message and the trace file reports an error similar to this:

java error 7713 writing response: 
java.io.IOException: con=0x000000000000,endpoint=10.0.0.1:80,bio=0x000000000000 max read/write len reached 10485760


Resolution


This is the expected behavior of an anti-DoS attack feature first added to the gateway in version 7.3, which set the maximum incoming bytes for both sent and received transactions. The limit displayed is often 10485760 bytes (10 MiB) or 20971520 bytes (20 MiB) because these are the defaults, with 10 MiB being the default in older configs and 20 MiB in more recently created configs. If you want to send or receive larger transactions, it is necessary to raise the limit. A higher limit will not consume any additional resources in and of itself, it will only permit larger transactions to be completed. Message bodies larger than the limit will be truncated.

The limits are configured under Server Settings in Policy Studio and you can configure the maximum sent and received bytes separately. The same settings can be found on the Advanced tab of each Remote Host. The settings in the Remote Host override those in General Settings for connections to the host specified in the Remote Host. Note that the settings also apply to the connection between the incoming client and the API Gateway. For that, you either need to create an incoming remote host or to change the settings under General Settings to allow large messages to be returned to your clients.

Further information on General Settings or Remote Hosts can be found in the documentation:


General Settings:



General Settings in Policy Studio


Remote Host:


Remote Host Advanced Tab