Skip to content

Commit a393dc5

Browse files
hpoettkerfmbenhassine
authored andcommitted
Replace deprecated IntegrationFlows
1 parent 61ea236 commit a393dc5

File tree

10 files changed

+33
-41
lines changed

10 files changed

+33
-41
lines changed

spring-batch-docs/src/main/asciidoc/spring-batch-integration.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public JobLaunchingGateway jobLaunchingGateway() {
285285
286286
@Bean
287287
public IntegrationFlow integrationFlow(JobLaunchingGateway jobLaunchingGateway) {
288-
return IntegrationFlows.from(Files.inboundAdapter(new File("/tmp/myfiles")).
288+
return IntegrationFlow.from(Files.inboundAdapter(new File("/tmp/myfiles")).
289289
filter(new SimplePatternFileListFilter("*.csv")),
290290
c -> c.poller(Pollers.fixedRate(1000).maxMessagesPerPoll(1))).
291291
transform(fileMessageToJobRequest()).
@@ -748,7 +748,7 @@ public DirectChannel requests() {
748748
749749
@Bean
750750
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
751-
return IntegrationFlows
751+
return IntegrationFlow
752752
.from(requests())
753753
.handle(Jms.outboundAdapter(connectionFactory).destination("requests"))
754754
.get();
@@ -764,7 +764,7 @@ public QueueChannel replies() {
764764
765765
@Bean
766766
public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
767-
return IntegrationFlows
767+
return IntegrationFlow
768768
.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies"))
769769
.channel(replies())
770770
.get();
@@ -862,7 +862,7 @@ public DirectChannel requests() {
862862
863863
@Bean
864864
public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
865-
return IntegrationFlows
865+
return IntegrationFlow
866866
.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
867867
.channel(requests())
868868
.get();
@@ -878,7 +878,7 @@ public DirectChannel replies() {
878878
879879
@Bean
880880
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
881-
return IntegrationFlows
881+
return IntegrationFlow
882882
.from(replies())
883883
.handle(Jms.outboundAdapter(connectionFactory).destination("replies"))
884884
.get();
@@ -1129,7 +1129,7 @@ public DirectChannel outboundRequests() {
11291129
11301130
@Bean
11311131
public IntegrationFlow outboundJmsRequests() {
1132-
return IntegrationFlows.from("outboundRequests")
1132+
return IntegrationFlow.from("outboundRequests")
11331133
.handle(Jms.outboundGateway(connectionFactory())
11341134
.requestDestination("requestsQueue"))
11351135
.get();
@@ -1152,7 +1152,7 @@ public DirectChannel inboundStaging() {
11521152
11531153
@Bean
11541154
public IntegrationFlow inboundJmsStaging() {
1155-
return IntegrationFlows
1155+
return IntegrationFlow
11561156
.from(Jms.messageDrivenChannelAdapter(connectionFactory())
11571157
.configureListenerContainer(c -> c.subscriptionDurable(false))
11581158
.destination("stagingQueue"))
@@ -1183,7 +1183,7 @@ public DirectChannel inboundRequests() {
11831183
}
11841184
11851185
public IntegrationFlow inboundJmsRequests() {
1186-
return IntegrationFlows
1186+
return IntegrationFlow
11871187
.from(Jms.messageDrivenChannelAdapter(connectionFactory())
11881188
.configureListenerContainer(c -> c.subscriptionDurable(false))
11891189
.destination("requestsQueue"))
@@ -1198,7 +1198,7 @@ public DirectChannel outboundStaging() {
11981198
11991199
@Bean
12001200
public IntegrationFlow outboundJmsStaging() {
1201-
return IntegrationFlows.from("outboundStaging")
1201+
return IntegrationFlow.from("outboundStaging")
12021202
.handle(Jms.outboundGateway(connectionFactory())
12031203
.requestDestination("stagingQueue"))
12041204
.get();

spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/RemoteChunkingWorkerBuilder.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020
import org.springframework.batch.item.ItemWriter;
2121
import org.springframework.batch.item.support.PassThroughItemProcessor;
2222
import org.springframework.integration.dsl.IntegrationFlow;
23-
import org.springframework.integration.dsl.IntegrationFlows;
2423
import org.springframework.messaging.MessageChannel;
2524
import org.springframework.util.Assert;
2625

@@ -117,8 +116,8 @@ public IntegrationFlow build() {
117116
ChunkProcessorChunkHandler<I> chunkProcessorChunkHandler = new ChunkProcessorChunkHandler<>();
118117
chunkProcessorChunkHandler.setChunkProcessor(chunkProcessor);
119118

120-
return IntegrationFlows.from(this.inputChannel)
121-
.handle(chunkProcessorChunkHandler, SERVICE_ACTIVATOR_METHOD_NAME).channel(this.outputChannel).get();
119+
return IntegrationFlow.from(this.inputChannel).handle(chunkProcessorChunkHandler, SERVICE_ACTIVATOR_METHOD_NAME)
120+
.channel(this.outputChannel).get();
122121
}
123122

124123
}

spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningManagerStepBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 the original author or authors.
2+
* Copyright 2019-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
3030
import org.springframework.beans.factory.BeanFactory;
3131
import org.springframework.integration.channel.QueueChannel;
3232
import org.springframework.integration.core.MessagingTemplate;
33-
import org.springframework.integration.dsl.IntegrationFlows;
33+
import org.springframework.integration.dsl.IntegrationFlow;
3434
import org.springframework.integration.dsl.StandardIntegrationFlow;
3535
import org.springframework.integration.dsl.context.IntegrationFlowContext;
3636
import org.springframework.messaging.MessageChannel;
@@ -207,7 +207,7 @@ public Step build() {
207207
else {
208208
PollableChannel replies = new QueueChannel();
209209
partitionHandler.setReplyChannel(replies);
210-
StandardIntegrationFlow standardIntegrationFlow = IntegrationFlows.from(this.inputChannel)
210+
StandardIntegrationFlow standardIntegrationFlow = IntegrationFlow.from(this.inputChannel)
211211
.aggregate(aggregatorSpec -> aggregatorSpec.processor(partitionHandler)).channel(replies).get();
212212
IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class);
213213
integrationFlowContext.registration(standardIntegrationFlow).autoStartup(false).register();

spring-batch-integration/src/main/java/org/springframework/batch/integration/partition/RemotePartitioningWorkerStepBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@
3838
import org.springframework.beans.factory.BeanFactory;
3939
import org.springframework.integration.channel.NullChannel;
4040
import org.springframework.integration.dsl.IntegrationFlow;
41-
import org.springframework.integration.dsl.IntegrationFlows;
4241
import org.springframework.integration.dsl.StandardIntegrationFlow;
4342
import org.springframework.integration.dsl.context.IntegrationFlowContext;
4443
import org.springframework.messaging.MessageChannel;
@@ -249,7 +248,7 @@ private void configureWorkerIntegrationFlow() {
249248
stepExecutionRequestHandler.setJobExplorer(this.jobExplorer);
250249
stepExecutionRequestHandler.setStepLocator(this.stepLocator);
251250

252-
StandardIntegrationFlow standardIntegrationFlow = IntegrationFlows.from(this.inputChannel)
251+
StandardIntegrationFlow standardIntegrationFlow = IntegrationFlow.from(this.inputChannel)
253252
.handle(stepExecutionRequestHandler, SERVICE_ACTIVATOR_METHOD_NAME).channel(this.outputChannel).get();
254253
IntegrationFlowContext integrationFlowContext = this.beanFactory.getBean(IntegrationFlowContext.class);
255254
integrationFlowContext.registration(standardIntegrationFlow).autoStartup(false).register();

spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/ManagerConfiguration.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,6 @@
3737
import org.springframework.integration.channel.QueueChannel;
3838
import org.springframework.integration.config.EnableIntegration;
3939
import org.springframework.integration.dsl.IntegrationFlow;
40-
import org.springframework.integration.dsl.IntegrationFlows;
4140
import org.springframework.integration.jms.dsl.Jms;
4241

4342
/**
@@ -81,7 +80,7 @@ public DirectChannel requests() {
8180

8281
@Bean
8382
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
84-
return IntegrationFlows.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests"))
83+
return IntegrationFlow.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests"))
8584
.get();
8685
}
8786

@@ -95,7 +94,7 @@ public QueueChannel replies() {
9594

9695
@Bean
9796
public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
98-
return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies"))
97+
return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies"))
9998
.channel(replies()).get();
10099
}
101100

spring-batch-samples/src/main/java/org/springframework/batch/sample/remotechunking/WorkerConfiguration.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
3232
import org.springframework.integration.channel.DirectChannel;
3333
import org.springframework.integration.config.EnableIntegration;
3434
import org.springframework.integration.dsl.IntegrationFlow;
35-
import org.springframework.integration.dsl.IntegrationFlows;
3635
import org.springframework.integration.jms.dsl.Jms;
3736

3837
/**
@@ -78,7 +77,7 @@ public DirectChannel requests() {
7877

7978
@Bean
8079
public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
81-
return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
80+
return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
8281
.channel(requests()).get();
8382
}
8483

@@ -92,7 +91,7 @@ public DirectChannel replies() {
9291

9392
@Bean
9493
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
95-
return IntegrationFlows.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies"))
94+
return IntegrationFlow.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies"))
9695
.get();
9796
}
9897

spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/ManagerConfiguration.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@
3131
import org.springframework.context.annotation.Import;
3232
import org.springframework.integration.channel.DirectChannel;
3333
import org.springframework.integration.dsl.IntegrationFlow;
34-
import org.springframework.integration.dsl.IntegrationFlows;
3534
import org.springframework.integration.jms.dsl.Jms;
3635

3736
/**
@@ -69,7 +68,7 @@ public DirectChannel requests() {
6968

7069
@Bean
7170
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
72-
return IntegrationFlows.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests"))
71+
return IntegrationFlow.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests"))
7372
.get();
7473
}
7574

@@ -83,7 +82,7 @@ public DirectChannel replies() {
8382

8483
@Bean
8584
public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
86-
return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies"))
85+
return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("replies"))
8786
.channel(replies()).get();
8887
}
8988

spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/aggregating/WorkerConfiguration.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
3232
import org.springframework.context.annotation.Import;
3333
import org.springframework.integration.channel.DirectChannel;
3434
import org.springframework.integration.dsl.IntegrationFlow;
35-
import org.springframework.integration.dsl.IntegrationFlows;
3635
import org.springframework.integration.jms.dsl.Jms;
3736

3837
/**
@@ -63,7 +62,7 @@ public DirectChannel requests() {
6362

6463
@Bean
6564
public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
66-
return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
65+
return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
6766
.channel(requests()).get();
6867
}
6968

@@ -77,7 +76,7 @@ public DirectChannel replies() {
7776

7877
@Bean
7978
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
80-
return IntegrationFlows.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies"))
79+
return IntegrationFlow.from(replies()).handle(Jms.outboundAdapter(connectionFactory).destination("replies"))
8180
.get();
8281
}
8382

spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/ManagerConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@
3131
import org.springframework.context.annotation.Import;
3232
import org.springframework.integration.channel.DirectChannel;
3333
import org.springframework.integration.dsl.IntegrationFlow;
34-
import org.springframework.integration.dsl.IntegrationFlows;
3534
import org.springframework.integration.jms.dsl.Jms;
3635

3736
/**
@@ -69,7 +68,7 @@ public DirectChannel requests() {
6968

7069
@Bean
7170
public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
72-
return IntegrationFlows.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests"))
71+
return IntegrationFlow.from(requests()).handle(Jms.outboundAdapter(connectionFactory).destination("requests"))
7372
.get();
7473
}
7574

spring-batch-samples/src/main/java/org/springframework/batch/sample/remotepartitioning/polling/WorkerConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
3232
import org.springframework.context.annotation.Import;
3333
import org.springframework.integration.channel.DirectChannel;
3434
import org.springframework.integration.dsl.IntegrationFlow;
35-
import org.springframework.integration.dsl.IntegrationFlows;
3635
import org.springframework.integration.jms.dsl.Jms;
3736

3837
/**
@@ -63,7 +62,7 @@ public DirectChannel requests() {
6362

6463
@Bean
6564
public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
66-
return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
65+
return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
6766
.channel(requests()).get();
6867
}
6968

0 commit comments

Comments
 (0)