This is an inherent problem when you use the Script Mediator for large payloads. The Micro Integrator uses Rhino engine to execute JavaScripts. Rhino engine converts the script to a method inside a Java class. Therefore, when processing large data volumes, the code length must be less than 65536 characters, since the Script mediator converts the payload into a Java object. However, you can use the following alternative options to process large JSON data volumes.
- Achieve the same functionality via a Class mediator.
- If the original message consists of repetitive sections, you can use
the Iterate mediator to generate a relatively small payload using
those repetitive sections. This will then allow you to use the Script
mediator.
- The Script Mediator supports using Nashorn to execute JavaScripts, in addition to its default Rhino engine. Hence you can try using the Nashhorn engine instead of the default Rhino engine. For this, you can change the language like below.
<script language="nashornJs">