Class BatchedJsonArraySplitter

  • All Implemented Interfaces:
    MessageSplitter

    @ComponentProfile(summary="Split a JSON Array into a smaller subset of arrays",
                      tag="json,splitting")
    public class BatchedJsonArraySplitter
    extends LargeJsonArraySplitter
    Split an arbitrarily large JSON array into smaller batches.

    This is a extension to LargeJsonArraySplitter; each resulting message is still a JSON array, it just contains slightly fewer elements than the original message.

    For instance given the following JSON Array;

     
    [
    {"colour": "red","value": "#f00"},
    {"colour": "green","value": "#0f0"},
    {"colour": "blue","value": "#00f"},
    {"colour": "black","value": "#000"}
    ]
       
     
    with a batchSize of 2 then we would expect to split messages; each a JSON array containing two elements. e.g. : [{ "colour": "red", "value": "#f00" }, { "colour": "green", "value": "#0f0"}] and [{ "colour": "blue","value": "#00f"}, { "colour": "black", "value": "#000"}]

    In the adapter configuration file this class is aliased as batched-json-array-splitter which is the preferred alternative to the fully qualified classname when building your configuration.