From f4cd2fb023ab519bc967efe82b2cc8502ecd7e97 Mon Sep 17 00:00:00 2001 From: Henning Poettker Date: Mon, 18 Jul 2022 21:36:39 +0200 Subject: [PATCH] Replace deprecated IntegrationFlows --- .../asciidoc/spring-batch-integration.adoc | 18 +++++++++--------- .../chunk/RemoteChunkingWorkerBuilder.java | 7 +++---- .../RemotePartitioningManagerStepBuilder.java | 6 +++--- .../RemotePartitioningWorkerStepBuilder.java | 5 ++--- .../remotechunking/ManagerConfiguration.java | 7 +++---- .../remotechunking/WorkerConfiguration.java | 7 +++---- .../aggregating/ManagerConfiguration.java | 7 +++---- .../aggregating/WorkerConfiguration.java | 7 +++---- .../polling/ManagerConfiguration.java | 5 ++--- .../polling/WorkerConfiguration.java | 5 ++--- 10 files changed, 33 insertions(+), 41 deletions(-) diff --git a/spring-batch-docs/src/main/asciidoc/spring-batch-integration.adoc b/spring-batch-docs/src/main/asciidoc/spring-batch-integration.adoc index cd4f41816c..0ebcbd746c 100644 --- a/spring-batch-docs/src/main/asciidoc/spring-batch-integration.adoc +++ b/spring-batch-docs/src/main/asciidoc/spring-batch-integration.adoc @@ -285,7 +285,7 @@ public JobLaunchingGateway jobLaunchingGateway() { @Bean public IntegrationFlow integrationFlow(JobLaunchingGateway jobLaunchingGateway) { - return IntegrationFlows.from(Files.inboundAdapter(new File("/tmp/myfiles")). + return IntegrationFlow.from(Files.inboundAdapter(new File("/tmp/myfiles")). filter(new SimplePatternFileListFilter("*.csv")), c -> c.poller(Pollers.fixedRate(1000).maxMessagesPerPoll(1))). transform(fileMessageToJobRequest()). @@ -748,7 +748,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows + return IntegrationFlow .from(requests()) .handle(Jms.outboundAdapter(connectionFactory).destination("requests")) .get(); @@ -764,7 +764,7 @@ public QueueChannel replies() { @Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows + return IntegrationFlow .from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies")) .channel(replies()) .get(); @@ -862,7 +862,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows + return IntegrationFlow .from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) .channel(requests()) .get(); @@ -878,7 +878,7 @@ public DirectChannel replies() { @Bean public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows + return IntegrationFlow .from(replies()) .handle(Jms.outboundAdapter(connectionFactory).destination("replies")) .get(); @@ -1129,7 +1129,7 @@ public DirectChannel outboundRequests() { @Bean public IntegrationFlow outboundJmsRequests() { - return IntegrationFlows.from("outboundRequests") + return IntegrationFlow.from("outboundRequests") .handle(Jms.outboundGateway(connectionFactory()) .requestDestination("requestsQueue")) .get(); @@ -1152,7 +1152,7 @@ public DirectChannel inboundStaging() { @Bean public IntegrationFlow inboundJmsStaging() { - return IntegrationFlows + return IntegrationFlow .from(Jms.messageDrivenChannelAdapter(connectionFactory()) .configureListenerContainer(c -> c.subscriptionDurable(false)) .destination("stagingQueue")) @@ -1183,7 +1183,7 @@ public DirectChannel inboundRequests() { } public IntegrationFlow inboundJmsRequests() { - return IntegrationFlows + return IntegrationFlow .from(Jms.messageDrivenChannelAdapter(connectionFactory()) .configureListenerContainer(c -> c.subscriptionDurable(false)) .destination("requestsQueue")) @@ -1198,7 +1198,7 @@ public DirectChannel outboundStaging() { @Bean public IntegrationFlow outboundJmsStaging() { - return IntegrationFlows.from("outboundStaging") + return IntegrationFlow.from("outboundStaging") .handle(Jms.outboundGateway(connectionFactory()) .requestDestination("stagingQueue")) .get(); diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingWorkerBuilder.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingWorkerBuilder.java index 5435a353a2..4282d97aa7 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingWorkerBuilder.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingWorkerBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import org.springframework.batch.item.ItemWriter; import org.springframework.batch.item.support.PassThroughItemProcessor; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.messaging.MessageChannel; import org.springframework.util.Assert; @@ -117,8 +116,8 @@ public IntegrationFlow build() { ChunkProcessorChunkHandler chunkProcessorChunkHandler = new ChunkProcessorChunkHandler<>(); chunkProcessorChunkHandler.setChunkProcessor(chunkProcessor); - return IntegrationFlows.from(this.inputChannel) - .handle(chunkProcessorChunkHandler, SERVICE_ACTIVATOR_METHOD_NAME).channel(this.outputChannel).get(); + return IntegrationFlow.from(this.inputChannel).handle(chunkProcessorChunkHandler, SERVICE_ACTIVATOR_METHOD_NAME) + .channel(this.outputChannel).get(); } } diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java index bcf5c6bdb4..46118d4856 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 the original author or authors. + * Copyright 2019-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.core.MessagingTemplate; -import org.springframework.integration.dsl.IntegrationFlows; +import org.springframework.integration.dsl.IntegrationFlow; import org.springframework.integration.dsl.StandardIntegrationFlow; import org.springframework.integration.dsl.context.IntegrationFlowContext; import org.springframework.messaging.MessageChannel; @@ -207,7 +207,7 @@ public Step build() { else { PollableChannel replies = new QueueChannel(); partitionHandler.setReplyChannel(replies); - StandardIntegrationFlow standardIntegrationFlow = IntegrationFlows.from(this.inputChannel) + StandardIntegrationFlow standardIntegrationFlow = IntegrationFlow.from(this.inputChannel) .aggregate(aggregatorSpec -> aggregatorSpec.processor(partitionHandler)).channel(replies).get(); IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class); integrationFlowContext.registration(standardIntegrationFlow).autoStartup(false).register(); diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java index 0f95ac12b6..999afa25b4 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.integration.channel.NullChannel; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.dsl.StandardIntegrationFlow; import org.springframework.integration.dsl.context.IntegrationFlowContext; import org.springframework.messaging.MessageChannel; @@ -249,7 +248,7 @@ private void configureWorkerIntegrationFlow() { stepExecutionRequestHandler.setJobExplorer(this.jobExplorer); stepExecutionRequestHandler.setStepLocator(this.stepLocator); - StandardIntegrationFlow standardIntegrationFlow = IntegrationFlows.from(this.inputChannel) + StandardIntegrationFlow standardIntegrationFlow = IntegrationFlow.from(this.inputChannel) .handle(stepExecutionRequestHandler, SERVICE_ACTIVATOR_METHOD_NAME).channel(this.outputChannel).get(); IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class); integrationFlowContext.registration(standardIntegrationFlow).autoStartup(false).register(); diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java index 652e637805..fc14eac080 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,6 @@ import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.jms.dsl.Jms; /** @@ -81,7 +80,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests")) + return IntegrationFlow.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests")) .get(); } @@ -95,7 +94,7 @@ public QueueChannel replies() { @Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies")) + return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies")) .channel(replies()).get(); } diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java index 5fb997a121..1da466a5d2 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.jms.dsl.Jms; /** @@ -78,7 +77,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) + return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) .channel(requests()).get(); } @@ -92,7 +91,7 @@ public DirectChannel replies() { @Bean public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies")) + return IntegrationFlow.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies")) .get(); } diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/ManagerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/ManagerConfiguration.java index 9aa25b5d72..ff71faffa9 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/ManagerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/ManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import org.springframework.context.annotation.Import; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.jms.dsl.Jms; /** @@ -69,7 +68,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests")) + return IntegrationFlow.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests")) .get(); } @@ -83,7 +82,7 @@ public DirectChannel replies() { @Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies")) + return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies")) .channel(replies()).get(); } diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/WorkerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/WorkerConfiguration.java index 0a07496a9d..d372fe61f6 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/WorkerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/WorkerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import org.springframework.context.annotation.Import; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.jms.dsl.Jms; /** @@ -63,7 +62,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) + return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) .channel(requests()).get(); } @@ -77,7 +76,7 @@ public DirectChannel replies() { @Bean public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies")) + return IntegrationFlow.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies")) .get(); } diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/ManagerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/ManagerConfiguration.java index d28b49db4a..6d35d0ff0f 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/ManagerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/ManagerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ import org.springframework.context.annotation.Import; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.jms.dsl.Jms; /** @@ -69,7 +68,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests")) + return IntegrationFlow.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests")) .get(); } diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java index ddd50e56ce..8b9fe42b41 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 the original author or authors. + * Copyright 2018-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import org.springframework.context.annotation.Import; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.dsl.IntegrationFlow; -import org.springframework.integration.dsl.IntegrationFlows; import org.springframework.integration.jms.dsl.Jms; /** @@ -63,7 +62,7 @@ public DirectChannel requests() { @Bean public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) { - return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) + return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests")) .channel(requests()).get(); }