Class JsonMergeAggregator

  • All Implemented Interfaces:
    MessageAggregator

    @ComponentProfile(summary="Merge each message into an existing JSON object.",
                      tag="json")
    public class JsonMergeAggregator
    extends JsonAggregatorImpl
    MessageAggregator implementation that merges each message to a JSON object or array.

    The payloads from the collection are assumed to be JSON objects, and will be aggregated into the pre-split message be it an object or array. Messages that are not JSON objects will be ignored but an error will be thrown should the pre-split message not be valid.

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

    • Field Detail

      • mapper

        protected transient com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • JsonMergeAggregator

        public JsonMergeAggregator()
    • Method Detail

      • getMergeMetadataKey

        public java.lang.String getMergeMetadataKey()
        Specify the metadata key that contains the 'key' against which the message will be merged into the original.
      • setMergeMetadataKey

        public void setMergeMetadataKey​(java.lang.String mergeMetadataKey)
        Specify the metadata key that contains the 'key' against which the message will be merged into the original.