@Test public void testProcessNoGroupedExchange() { Exchange exchange = mock(Exchange.class); List<Message> res = aggregator.process(exchange); assertNotNull(res); assertTrue(res.isEmpty()); }
public List<Message> process(Exchange exchange) { List<Exchange> grouped = exchange.getProperty(Exchange.GROUPED_EXCHANGE, List.class); if (grouped == null || grouped.isEmpty()) { LOG.info("No aggregated log messages, this is normal if camel aggregator has a batch timeout. Doing nothing."); return Collections.emptyList(); } List<Message> aggregatedList = grouped.stream() .map(Exchange::getIn) .collect(Collectors.toList()); return new NotificationMessageDiscardFilter().process(aggregatedList); }
NotificationAggregator { public List<Message> process(Exchange exchange) { List<Exchange> grouped = exchange.getProperty(Exchange.GROUPED_EXCHANGE, List.class); if (grouped == null || grouped.isEmpty()) { LOG.info("No aggregated log messages, this is normal if camel aggregator has a batch timeout. Doing nothing."); return Collections.emptyList(); } List<Message> aggregatedList = grouped.stream() .map(Exchange::getIn) .collect(Collectors.toList()); return new NotificationMessageDiscardFilter().process(aggregatedList); } }
NotificationAggregator { public List<Message> process(Exchange exchange) { List<Exchange> grouped = exchange.getProperty(Exchange.GROUPED_EXCHANGE, List.class); if (grouped == null || grouped.isEmpty()) { LOG.info("No aggregated log messages, this is normal if camel aggregator has a batch timeout. Doing nothing."); return Collections.emptyList(); } List<Message> aggregatedList = grouped.stream() .map(Exchange::getIn) .collect(Collectors.toList()); return new NotificationMessageDiscardFilter().process(aggregatedList); }  }
NotificationAggregator { public List<Message> process(Exchange exchange) { List<Exchange> grouped = exchange.getProperty(Exchange.GROUPED_EXCHANGE, List.class); if (grouped == null || grouped.isEmpty()) { LOG.info("No aggregated log messages, this is normal if camel aggregator has a batch timeout. Doing nothing."); return Collections.emptyList(); } List<Message> aggregatedList = grouped.stream() .map(Exchange::getIn) .collect(Collectors.toList()); return new NotificationMessageDiscardFilter().process(aggregatedList); }  List<Message> process(Exchange exchange); }
NotificationAggregator { public List<Message> process(Exchange exchange) { List<Exchange> grouped = exchange.getProperty(Exchange.GROUPED_EXCHANGE, List.class); if (grouped == null || grouped.isEmpty()) { LOG.info("No aggregated log messages, this is normal if camel aggregator has a batch timeout. Doing nothing."); return Collections.emptyList(); } List<Message> aggregatedList = grouped.stream() .map(Exchange::getIn) .collect(Collectors.toList()); return new NotificationMessageDiscardFilter().process(aggregatedList); }  List<Message> process(Exchange exchange);  }