@Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { return IntegrationFlows .from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies")) .channel(replies()) .get(); }
@Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { return IntegrationFlows .from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) .channel(requests()) .get(); }
@Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { return IntegrationFlows .from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies")) .channel(replies()) .get(); }
@Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { return IntegrationFlows .from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) .channel(requests()) .get(); }
@Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { return IntegrationFlows .from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) .channel(requests()) .get(); }
/** * Create an {@link IntegrationFlow} with a {@link ChunkProcessorChunkHandler} * configured as a service activator listening to the input channel and replying * on the output channel. * * @return the integration flow */ @SuppressWarnings({"unchecked", "rawtypes"}) public IntegrationFlow build() { Assert.notNull(this.itemWriter, "An ItemWriter must be provided"); Assert.notNull(this.inputChannel, "An InputChannel must be provided"); Assert.notNull(this.outputChannel, "An OutputChannel must be provided"); if(this.itemProcessor == null) { this.itemProcessor = new PassThroughItemProcessor(); } SimpleChunkProcessor<I, O> chunkProcessor = new SimpleChunkProcessor<>(this.itemProcessor, this.itemWriter); ChunkProcessorChunkHandler<I> chunkProcessorChunkHandler = new ChunkProcessorChunkHandler<>(); chunkProcessorChunkHandler.setChunkProcessor(chunkProcessor); return IntegrationFlows .from(this.inputChannel) .handle(chunkProcessorChunkHandler, SERVICE_ACTIVATOR_METHOD_NAME) .channel(this.outputChannel) .get(); }
.from(this.inputChannel) .handle(stepExecutionRequestHandler, SERVICE_ACTIVATOR_METHOD_NAME) .channel(this.outputChannel) .get(); IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class);
.from(this.inputChannel) .aggregate(aggregatorSpec -> aggregatorSpec.processor(partitionHandler)) .channel(replies) .get(); IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class);
/** * Populate the provided {@link MessageChannel} object to the {@link IntegrationFlowBuilder} chain. * The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}. * @param messageChannel the {@link MessageChannel} to populate. * @return new {@link IntegrationFlowBuilder}. */ public static IntegrationFlowBuilder from(MessageChannel messageChannel) { return new IntegrationFlowBuilder().channel(messageChannel); }
@Bean public IntegrationFlow subFlow() { return IntegrationFlows .from("processChannel") .<String, String>transform(String::toUpperCase) .channel("replyChannel") .get(); }
@Bean public IntegrationFlow bridgeFlow() { return IntegrationFlows.from(MessageChannels.queue("bridgeFlowInput")) .channel(MessageChannels.queue("bridgeFlowOutput")) .get(); }
@Bean public IntegrationFlow myFlow() { return IntegrationFlows .from(() -> new GenericMessage<>("myData"), e -> e.id("mySourceEndpoint")) .<String, String>transform(String::toUpperCase) .channel(results()) .get(); }
@Bean public IntegrationFlow jmsInboundFlow() { return IntegrationFlows .from(Jms.inboundAdapter(jmsConnectionFactory()).destination("jmsInbound")) .<String, String>transform(String::toUpperCase) .channel(this.jmsOutboundInboundReplyChannel()) .get(); }
@Bean public Publisher<Message<Integer>> pollableReactiveFlow() { return IntegrationFlows .from("inputChannel") .split(s -> s.delimiters(",")) .<String, Integer>transform(Integer::parseInt) .channel(MessageChannels.queue()) .log() .toReactivePublisher(); }
@Bean public IntegrationFlow fileWritingFlow() { return IntegrationFlows.from("fileWritingInput") .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "foo.write") .header("directory", new File(tmpDir.getRoot(), "fileWritingFlow"))) .handle(Files.outboundGateway(m -> m.getHeaders().get("directory")) .preserveTimestamp(true) .chmod(0777)) .channel(MessageChannels.queue("fileWritingResultChannel")) .get(); }
@Bean public IntegrationFlow jmsMessageDrivenFlowWithContainer() { return IntegrationFlows .from(Jms.messageDrivenChannelAdapter( Jms.container(jmsConnectionFactory(), "containerSpecDestination") .pubSubDomain(false) .taskExecutor(Executors.newCachedThreadPool()) .get())) .transform(String::trim) .channel(jmsOutboundInboundReplyChannel()) .get(); }
@Bean public IntegrationFlow pollingAdapterFlow(EntityManagerFactory entityManagerFactory) { return IntegrationFlows .from(Jpa.inboundAdapter(entityManagerFactory) .entityClass(StudentDomain.class) .maxResults(1) .expectSingleResult(true), e -> e.poller(p -> p.trigger(new OnlyOnceTrigger()))) .channel(c -> c.queue("pollingResults")) .get(); }
@Bean public IntegrationFlow jmsMessageDrivenFlow() { return IntegrationFlows .from(Jms.messageDrivenChannelAdapter(jmsConnectionFactory(), DefaultMessageListenerContainer.class) .outputChannel(jmsMessageDrivenInputChannel()) .destination("jmsMessageDriven") .configureListenerContainer(c -> c.clientId("foo"))) .<String, String>transform(String::toLowerCase) .channel(jmsOutboundInboundReplyChannel()) .get(); }
@Bean public IntegrationFlow bridgeFlow2() { return IntegrationFlows.from("bridgeFlow2Input") .bridge(c -> c.autoStartup(false).id("bridge")) .fixedSubscriberChannel() .delay("delayer", d -> d .delayExpression("200") .advice(this.delayedAdvice) .messageStore(this.messageStore())) .channel(MessageChannels.queue("bridgeFlow2Output")) .get(); }
@Override @Bean public IntegrationFlow flow() { return IntegrationFlows.from(Ftp.inboundStreamingAdapter(new FtpRemoteFileTemplate(sf())) .filter(new FtpPersistentAcceptOnceFileListFilter(new SimpleMetadataStore(), "rotate")) .remoteDirectory("."), e -> e.poller(Pollers.fixedDelay(1).advice(advice()))) .channel(MessageChannels.queue("files")) .get(); }