/** * Configure the handler with {@link org.springframework.integration.aggregator.MethodInvokingCorrelationStrategy} * and {@link org.springframework.integration.aggregator.MethodInvokingReleaseStrategy} using the target * object which should have methods annotated appropriately for each function. * Also set the output processor. * @param target the target object. * @return the handler spec. */ public AggregatorSpec processor(Object target) { return processor(target, null); }
StandardIntegrationFlow standardIntegrationFlow = IntegrationFlows .from(this.inputChannel) .aggregate(aggregatorSpec -> aggregatorSpec.processor(partitionHandler)) .channel(replies) .get();
/** * Configure the handler with {@link org.springframework.integration.aggregator.MethodInvokingCorrelationStrategy} * and {@link org.springframework.integration.aggregator.MethodInvokingReleaseStrategy} using the target * object which should have methods annotated appropriately for each function. * Also set the output processor. * @param target the target object. * @return the handler spec. */ public AggregatorSpec processor(Object target) { return processor(target, null); }
/** * Configure the handler with {@link org.springframework.integration.aggregator.MethodInvokingCorrelationStrategy} * and {@link org.springframework.integration.aggregator.MethodInvokingReleaseStrategy} using the target * object which should have methods annotated appropriately for each function. * Also set the output processor. * @param target the target object. * @return the handler spec. * @since 1.2 */ public AggregatorSpec processor(Object target) { return processor(target, null); }
/** * Configure the handler with {@link org.springframework.integration.aggregator.MethodInvokingCorrelationStrategy} * and {@link org.springframework.integration.aggregator.MethodInvokingReleaseStrategy} using the target * object which should have methods annotated appropriately for each function. * Also set the output processor. * @param target the target object. * @return the handler spec. * @since 1.2 */ public AggregatorSpec processor(Object target) { return processor(target, null); }
@Override protected IntegrationFlowDefinition<?> buildFlow() { return from(this, "messageSource", e -> e.poller(p -> p.trigger(this::nextExecutionTime))) .split(this, null, e -> e.applySequence(false)) .transform(this) .aggregate(a -> a.processor(this, null)) .enrichHeaders(Collections.singletonMap("foo", "FOO")) .filter(this) .handle(this) .channel(MessageChannels.queue("myFlowAdapterOutput")) .log(); }
@Override protected IntegrationFlowDefinition<?> buildFlow() { return from(this, "messageSource", e -> e.poller(p -> p.trigger(this::nextExecutionTime))) .split(this, null, e -> e.applySequence(false)) .transform(this) .aggregate(a -> a.processor(this, null)) .enrichHeaders(Collections.singletonMap("foo", "FOO")) .filter(this) .handle(this) .channel(c -> c.queue("myFlowAdapterOutput")); }
@Bean public IntegrationFlow fileSplitterAggregator() { return IntegrationFlows .from(Files.inboundAdapter(new File("/tmp/in")) .autoCreateDirectory(true) .patternFilter("*.txt"), e -> e.poller(Pollers.fixedDelay(5000))) .split(Files.splitter() .markers() .applySequence(true)) .filter(p -> !(p instanceof FileSplitter.FileMarker), e -> e.discardChannel("aggregatorChannel")) .<String, Name>transform(Name::new) .<Name>filter(p -> !p.getValue().startsWith("X")) .channel("aggregatorChannel") .aggregate(a -> a.processor(new FileMarkerAggregator())) .<List<Name>, Names>transform(Names::new) .transform(Transformers.marshaller(jaxbMarshaller(), new ResultToStringTransformer())) .handle(Files.outboundAdapter("'/tmp/out'") .fileNameGenerator(m -> m .getHeaders() .get(FileHeaders.FILENAME, String.class) .replace(".txt", ".xml")) .autoCreateDirectory(true)) .get(); }