Class StringAggregationStrategy

  • All Implemented Interfaces:
    org.apache.camel.AggregationStrategy

    public class StringAggregationStrategy
    extends Object
    implements org.apache.camel.AggregationStrategy
    Aggregate result of pick expression into a single combined Exchange holding all the aggregated bodies in a String as the message body. This aggregation strategy can used in combination with Splitter to batch messages
    • Constructor Detail

      • StringAggregationStrategy

        public StringAggregationStrategy()
    • Method Detail

      • delimiter

        public StringAggregationStrategy delimiter​(String delimiter)
        Set delimiter used for joining aggregated String
        Parameters:
        delimiter - The delimiter to join with. Default empty String
      • pick

        public StringAggregationStrategy pick​(org.apache.camel.Expression expression)
        Set an expression to extract the element to be aggregated from the incoming Exchange.

        By default, it picks the full IN message body of the incoming exchange.

        Parameters:
        expression - The picking expression.
        Returns:
        This instance.
      • aggregate

        public org.apache.camel.Exchange aggregate​(org.apache.camel.Exchange oldExchange,
                                                   org.apache.camel.Exchange newExchange)
        Specified by:
        aggregate in interface org.apache.camel.AggregationStrategy
      • onCompletion

        public void onCompletion​(org.apache.camel.Exchange exchange)
        Specified by:
        onCompletion in interface org.apache.camel.AggregationStrategy