Skip to content

Commit 7a30b39

Browse files
authored
Address deprecation warnings
Remove the usage of deprecated `IntegrationFlows` in favor of `IntegrationFlow`
1 parent eccdf79 commit 7a30b39

File tree

13 files changed

+36
-41
lines changed

13 files changed

+36
-41
lines changed

functions/consumer/ftp-consumer/src/main/java/org/springframework/cloud/fn/consumer/ftp/FtpConsumerConfiguration.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2023 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.expression.spel.standard.SpelExpressionParser;
3232
import org.springframework.integration.dsl.IntegrationFlow;
3333
import org.springframework.integration.dsl.IntegrationFlowBuilder;
34-
import org.springframework.integration.dsl.IntegrationFlows;
3534
import org.springframework.integration.file.remote.session.SessionFactory;
3635
import org.springframework.integration.ftp.dsl.Ftp;
3736
import org.springframework.integration.ftp.dsl.FtpMessageHandlerSpec;
@@ -54,7 +53,7 @@ public IntegrationFlow ftpInboundFlow(FtpConsumerProperties properties, SessionF
5453
@Nullable ComponentCustomizer<FtpMessageHandlerSpec> ftpMessageHandlerSpecCustomizer) {
5554

5655
IntegrationFlowBuilder integrationFlowBuilder =
57-
IntegrationFlows.from(MessageConsumer.class, (gateway) -> gateway.beanName("ftpConsumer"));
56+
IntegrationFlow.from(MessageConsumer.class, (gateway) -> gateway.beanName("ftpConsumer"));
5857

5958
FtpMessageHandlerSpec handlerSpec =
6059
Ftp.outboundAdapter(new FtpRemoteFileTemplate(ftpSessionFactory), properties.getMode())

functions/consumer/jdbc-consumer/src/main/java/org/springframework/cloud/fn/consumer/jdbc/JdbcConsumerConfiguration.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2020-2023 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.
@@ -48,7 +48,6 @@
4848
import org.springframework.integration.config.AggregatorFactoryBean;
4949
import org.springframework.integration.dsl.IntegrationFlow;
5050
import org.springframework.integration.dsl.IntegrationFlowBuilder;
51-
import org.springframework.integration.dsl.IntegrationFlows;
5251
import org.springframework.integration.expression.ExpressionUtils;
5352
import org.springframework.integration.expression.ValueExpression;
5453
import org.springframework.integration.jdbc.JdbcMessageHandler;
@@ -130,7 +129,7 @@ IntegrationFlow jdbcConsumerFlow(@Qualifier("aggregator") MessageHandler aggrega
130129
JdbcMessageHandler jdbcMessageHandler) {
131130

132131
final IntegrationFlowBuilder builder =
133-
IntegrationFlows.from(Consumer.class, gateway -> gateway.beanName("jdbcConsumer"));
132+
IntegrationFlow.from(Consumer.class, gateway -> gateway.beanName("jdbcConsumer"));
134133
if (properties.getBatchSize() > 1 || properties.getIdleTimeout() > 0) {
135134
builder.handle(aggregator);
136135
}

functions/consumer/log-consumer/src/main/java/org/springframework/cloud/fn/consumer/log/LogConsumerConfiguration.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2023 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.
@@ -22,7 +22,6 @@
2222
import org.springframework.context.annotation.Bean;
2323
import org.springframework.context.annotation.Configuration;
2424
import org.springframework.integration.dsl.IntegrationFlow;
25-
import org.springframework.integration.dsl.IntegrationFlows;
2625
import org.springframework.messaging.Message;
2726

2827
/**
@@ -41,7 +40,7 @@ public class LogConsumerConfiguration {
4140

4241
@Bean
4342
IntegrationFlow logConsumerFlow(LogConsumerProperties logSinkProperties) {
44-
return IntegrationFlows.from(MessageConsumer.class, (gateway) -> gateway.beanName("logConsumer"))
43+
return IntegrationFlow.from(MessageConsumer.class, (gateway) -> gateway.beanName("logConsumer"))
4544
.log(logSinkProperties.getLevel(), logSinkProperties.getName(), logSinkProperties.getExpression())
4645
.nullChannel();
4746
}

functions/consumer/sftp-consumer/src/main/java/org/springframework/cloud/fn/consumer/sftp/SftpConsumerConfiguration.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2023 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.
@@ -27,7 +27,6 @@
2727
import org.springframework.context.annotation.Import;
2828
import org.springframework.integration.dsl.IntegrationFlow;
2929
import org.springframework.integration.dsl.IntegrationFlowBuilder;
30-
import org.springframework.integration.dsl.IntegrationFlows;
3130
import org.springframework.integration.file.remote.session.SessionFactory;
3231
import org.springframework.integration.sftp.dsl.Sftp;
3332
import org.springframework.integration.sftp.dsl.SftpMessageHandlerSpec;
@@ -51,7 +50,7 @@ public IntegrationFlow ftpOutboundFlow(SftpConsumerProperties properties,
5150
@Nullable ComponentCustomizer<SftpMessageHandlerSpec> sftpMessageHandlerSpecCustomizer) {
5251

5352
IntegrationFlowBuilder integrationFlowBuilder =
54-
IntegrationFlows.from(MessageConsumer.class, (gateway) -> gateway.beanName("sftpConsumer"));
53+
IntegrationFlow.from(MessageConsumer.class, (gateway) -> gateway.beanName("sftpConsumer"));
5554

5655
SftpMessageHandlerSpec handlerSpec =
5756
Sftp.outboundAdapter(new SftpRemoteFileTemplate(ftpSessionFactory), properties.getMode())

functions/supplier/file-supplier/src/main/java/org/springframework/cloud/fn/supplier/file/FileSupplierConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2023 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.
@@ -35,8 +35,8 @@
3535
import org.springframework.context.annotation.Bean;
3636
import org.springframework.context.annotation.Configuration;
3737
import org.springframework.context.annotation.Lazy;
38+
import org.springframework.integration.dsl.IntegrationFlow;
3839
import org.springframework.integration.dsl.IntegrationFlowBuilder;
39-
import org.springframework.integration.dsl.IntegrationFlows;
4040
import org.springframework.integration.file.FileReadingMessageSource;
4141
import org.springframework.integration.file.dsl.FileInboundChannelAdapterSpec;
4242
import org.springframework.integration.file.dsl.Files;
@@ -120,7 +120,7 @@ public Flux<Message<?>> fileMessageFlux() {
120120
@Bean
121121
@ConditionalOnExpression("environment['file.consumer.mode'] != 'ref'")
122122
public Publisher<Message<Object>> fileReadingFlow() {
123-
IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(fileMessageFlux());
123+
IntegrationFlowBuilder flowBuilder = IntegrationFlow.from(fileMessageFlux());
124124
return FileUtils.enhanceFlowForReadingMode(flowBuilder, this.fileConsumerProperties)
125125
.toReactivePublisher();
126126
}

functions/supplier/ftp-supplier/src/main/java/org/springframework/cloud/fn/supplier/ftp/FtpSupplierConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2023 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.
@@ -39,7 +39,7 @@
3939
import org.springframework.context.annotation.Configuration;
4040
import org.springframework.context.annotation.Import;
4141
import org.springframework.context.annotation.Lazy;
42-
import org.springframework.integration.dsl.IntegrationFlows;
42+
import org.springframework.integration.dsl.IntegrationFlow;
4343
import org.springframework.integration.file.filters.ChainFileListFilter;
4444
import org.springframework.integration.file.remote.session.SessionFactory;
4545
import org.springframework.integration.ftp.dsl.Ftp;
@@ -136,7 +136,7 @@ public Flux<Message<?>> ftpMessageFlux() {
136136
@Bean
137137
@ConditionalOnExpression("environment['file.consumer.mode'] != 'ref'")
138138
public Publisher<Message<Object>> ftpReadingFlow(FtpInboundFileSynchronizingMessageSource ftpMessageSource) {
139-
return FileUtils.enhanceFlowForReadingMode(IntegrationFlows
139+
return FileUtils.enhanceFlowForReadingMode(IntegrationFlow
140140
.from(IntegrationReactiveUtils.messageSourceToFlux(ftpMessageSource)), fileConsumerProperties)
141141
.toReactivePublisher();
142142
}

functions/supplier/http-supplier/src/main/java/org/springframework/cloud/fn/supplier/http/HttpSupplierConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2021 the original author or authors.
2+
* Copyright 2011-2023 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.
@@ -29,7 +29,7 @@
2929
import org.springframework.http.HttpStatus;
3030
import org.springframework.http.MediaType;
3131
import org.springframework.http.codec.ServerCodecConfigurer;
32-
import org.springframework.integration.dsl.IntegrationFlows;
32+
import org.springframework.integration.dsl.IntegrationFlow;
3333
import org.springframework.integration.expression.ValueExpression;
3434
import org.springframework.integration.http.support.DefaultHttpHeaderMapper;
3535
import org.springframework.integration.mapping.HeaderMapper;
@@ -60,7 +60,7 @@ public Publisher<Message<byte[]>> httpSupplierFlow(HttpSupplierProperties httpSu
6060
HeaderMapper<HttpHeaders> httpHeaderMapper,
6161
ServerCodecConfigurer serverCodecConfigurer) {
6262

63-
return IntegrationFlows.from(
63+
return IntegrationFlow.from(
6464
WebFlux.inboundChannelAdapter(httpSupplierProperties.getPathPattern())
6565
.requestPayloadType(byte[].class)
6666
.statusCodeExpression(new ValueExpression<>(HttpStatus.ACCEPTED))

functions/supplier/jms-supplier/src/main/java/org/springframework/cloud/fn/supplier/jms/JmsSupplierConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2022 the original author or authors.
2+
* Copyright 2016-2023 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.
@@ -28,7 +28,7 @@
2828
import org.springframework.cloud.fn.common.config.ComponentCustomizer;
2929
import org.springframework.context.annotation.Bean;
3030
import org.springframework.context.annotation.Configuration;
31-
import org.springframework.integration.dsl.IntegrationFlows;
31+
import org.springframework.integration.dsl.IntegrationFlow;
3232
import org.springframework.integration.jms.dsl.Jms;
3333
import org.springframework.integration.jms.dsl.JmsMessageDrivenChannelAdapterSpec;
3434
import org.springframework.jms.listener.AbstractMessageListenerContainer;
@@ -67,7 +67,7 @@ public Publisher<Message<byte[]>> jmsPublisher(
6767
jmsMessageDrivenChannelAdapterSpecCustomizer.customize(messageProducerSpec);
6868
}
6969

70-
return IntegrationFlows.from(messageProducerSpec)
70+
return IntegrationFlow.from(messageProducerSpec)
7171
.toReactivePublisher(true);
7272
}
7373

functions/supplier/mqtt-supplier/src/main/java/org/springframework/cloud/fn/supplier/mqtt/MqttSupplierConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2022 the original author or authors.
2+
* Copyright 2017-2023 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.context.annotation.Bean;
3131
import org.springframework.context.annotation.Configuration;
3232
import org.springframework.context.annotation.Import;
33-
import org.springframework.integration.dsl.IntegrationFlows;
33+
import org.springframework.integration.dsl.IntegrationFlow;
3434
import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
3535
import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
3636
import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter;
@@ -82,7 +82,7 @@ public MqttPahoMessageDrivenChannelAdapter mqttInbound(
8282

8383
@Bean
8484
public Publisher<Message<byte[]>> mqttPublisher(MqttPahoMessageDrivenChannelAdapter mqttInbound) {
85-
return IntegrationFlows.from(mqttInbound)
85+
return IntegrationFlow.from(mqttInbound)
8686
.toReactivePublisher(true);
8787
}
8888

functions/supplier/rabbit-supplier/src/main/java/org/springframework/cloud/fn/supplier/rabbit/RabbitSupplierConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2022 the original author or authors.
2+
* Copyright 2016-2023 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.
@@ -49,7 +49,7 @@
4949
import org.springframework.core.io.ResourceLoader;
5050
import org.springframework.integration.amqp.dsl.Amqp;
5151
import org.springframework.integration.amqp.dsl.AmqpInboundChannelAdapterSMLCSpec;
52-
import org.springframework.integration.dsl.IntegrationFlows;
52+
import org.springframework.integration.dsl.IntegrationFlow;
5353
import org.springframework.lang.Nullable;
5454
import org.springframework.messaging.Message;
5555
import org.springframework.retry.interceptor.RetryOperationsInterceptor;
@@ -159,7 +159,7 @@ public Publisher<Message<byte[]>> rabbitPublisher(SimpleMessageListenerContainer
159159
amqpMessageProducerCustomizer.customize(messageProducerSpec);
160160
}
161161

162-
return IntegrationFlows.from(messageProducerSpec)
162+
return IntegrationFlow.from(messageProducerSpec)
163163
.toReactivePublisher(true);
164164
}
165165

functions/supplier/sftp-supplier/src/main/java/org/springframework/cloud/fn/supplier/sftp/SftpSupplierConfiguration.java

+4-5
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-2023 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.
@@ -50,7 +50,6 @@
5050
import org.springframework.integration.core.MessageSource;
5151
import org.springframework.integration.dsl.IntegrationFlow;
5252
import org.springframework.integration.dsl.IntegrationFlowBuilder;
53-
import org.springframework.integration.dsl.IntegrationFlows;
5453
import org.springframework.integration.endpoint.MessageProducerSupport;
5554
import org.springframework.integration.file.FileHeaders;
5655
import org.springframework.integration.file.filters.ChainFileListFilter;
@@ -211,7 +210,7 @@ public Publisher<Message<Object>> sftpReadingFlow(
211210
SftpSupplierProperties sftpSupplierProperties,
212211
FileConsumerProperties fileConsumerProperties) {
213212

214-
return FileUtils.enhanceStreamFlowForReadingMode(IntegrationFlows
213+
return FileUtils.enhanceStreamFlowForReadingMode(IntegrationFlow
215214
.from(IntegrationReactiveUtils.messageSourceToFlux(sftpMessageSource)
216215
.delaySubscription(subscriptionBarrier)
217216
.contextWrite(Context.of(IntegrationReactiveUtils.DELAY_WHEN_EMPTY_KEY,
@@ -258,7 +257,7 @@ public Publisher<Message<Object>> sftpReadingFlow(
258257
FileConsumerProperties fileConsumerProperties,
259258
@Nullable MessageHandler renameRemoteFileHandler) {
260259

261-
IntegrationFlowBuilder flowBuilder = FileUtils.enhanceFlowForReadingMode(IntegrationFlows
260+
IntegrationFlowBuilder flowBuilder = FileUtils.enhanceFlowForReadingMode(IntegrationFlow
262261
.from(IntegrationReactiveUtils.messageSourceToFlux(sftpMessageSource)
263262
.delaySubscription(subscriptionBarrier)
264263
.contextWrite(Context.of(IntegrationReactiveUtils.DELAY_WHEN_EMPTY_KEY,
@@ -367,7 +366,7 @@ public IntegrationFlow listingFlow(MessageProducerSupport listingMessageProducer
367366
GenericSelector<Message<?>> duplicateFilter,
368367
GenericSelector<String> listOnlyFilter) {
369368

370-
return IntegrationFlows.from(listingMessageProducer)
369+
return IntegrationFlow.from(listingMessageProducer)
371370
.split()
372371
.transform(lsEntryToStringTransformer)
373372
.filter(duplicateFilter)

functions/supplier/tcp-supplier/src/main/java/org/springframework/cloud/fn/supplier/tcp/TcpSupplierConfiguration.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2021 the original author or authors.
2+
* Copyright 2015-2023 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.
@@ -27,7 +27,7 @@
2727
import org.springframework.cloud.fn.common.tcp.TcpConnectionFactoryProperties;
2828
import org.springframework.context.annotation.Bean;
2929
import org.springframework.context.annotation.Configuration;
30-
import org.springframework.integration.dsl.IntegrationFlows;
30+
import org.springframework.integration.dsl.IntegrationFlow;
3131
import org.springframework.integration.ip.IpHeaders;
3232
import org.springframework.integration.ip.config.TcpConnectionFactoryFactoryBean;
3333
import org.springframework.integration.ip.tcp.TcpReceivingChannelAdapter;
@@ -82,7 +82,7 @@ public TcpReceivingChannelAdapter adapter(
8282

8383
@Bean
8484
public Publisher<Message<Object>> tcpSupplierFlow(TcpReceivingChannelAdapter adapter) {
85-
return IntegrationFlows.from(adapter)
85+
return IntegrationFlow.from(adapter)
8686
.headerFilter(IpHeaders.LOCAL_ADDRESS)
8787
.toReactivePublisher();
8888
}

functions/supplier/websocket-supplier/src/main/java/org/springframework/cloud/fn/supplier/websocket/WebsocketSupplierConfiguration.java

+3-3
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-2023 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.
@@ -28,7 +28,7 @@
2828
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2929
import org.springframework.context.annotation.Bean;
3030
import org.springframework.context.annotation.Configuration;
31-
import org.springframework.integration.dsl.IntegrationFlows;
31+
import org.springframework.integration.dsl.IntegrationFlow;
3232
import org.springframework.integration.websocket.IntegrationWebSocketContainer;
3333
import org.springframework.integration.websocket.ServerWebSocketContainer;
3434
import org.springframework.integration.websocket.inbound.WebSocketInboundChannelAdapter;
@@ -58,7 +58,7 @@ public Supplier<Flux<Message<?>>> websocketSupplier(Publisher<Message<?>> websoc
5858

5959
@Bean
6060
public Publisher<Message<byte[]>> websocketPublisher(IntegrationWebSocketContainer serverWebSocketContainer) {
61-
return IntegrationFlows.from(
61+
return IntegrationFlow.from(
6262
webSocketInboundChannelAdapter(serverWebSocketContainer))
6363
.toReactivePublisher();
6464
}

0 commit comments

Comments
 (0)