GH-3623: Deprecarte an IntegrationFlows

Fixes https://github.com/spring-projects/spring-integration/issues/3623

* `IntegrationFlow` refactoring
* Apply several code style improvements and good practices
* Code style: no empty lines for methods javadocs
* make deprecated implementation reuse actual one instead of the copy-paste approach
* add whats-new comments
* Fix whats-new page according to standards
This commit is contained in:
Artem Vozhdayenko
2022-07-05 22:47:30 +03:00
committed by GitHub
parent 63759d76b9
commit 53dd050c5b
90 changed files with 796 additions and 570 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2021 the original author or authors.
* Copyright 2021-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.integration.channel.DirectChannel;
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.dsl.Pollers;
import org.springframework.integration.dsl.context.IntegrationFlowContext;
import org.springframework.integration.scheduling.PollerMetadata;
@@ -124,14 +123,14 @@ public class IntegrationFlowCompositionTests {
IntegrationFlow startFlow = f -> f.handle(m -> { });
assertThatIllegalArgumentException()
.isThrownBy(() -> IntegrationFlows.from(startFlow))
.isThrownBy(() -> IntegrationFlow.from(startFlow))
.withMessageContaining("must be declared as a bean in the application context");
IntegrationFlowContext.IntegrationFlowRegistration startRegistration =
this.integrationFlowContext.registration(startFlow).register();
assertThatExceptionOfType(BeanCreationException.class)
.isThrownBy(() -> IntegrationFlows.from(startRegistration.getIntegrationFlow()))
.isThrownBy(() -> IntegrationFlow.from(startRegistration.getIntegrationFlow()))
.withMessageContaining("The 'IntegrationFlow' to start from must end with " +
"a 'MessageChannel' or reply-producing endpoint");
@@ -175,14 +174,14 @@ public class IntegrationFlowCompositionTests {
@Bean
IntegrationFlow templateSourceFlow() {
return IntegrationFlows.fromSupplier(() -> "test data")
return IntegrationFlow.fromSupplier(() -> "test data")
.channel("sourceChannel")
.get();
}
@Bean
IntegrationFlow compositionMainFlow(IntegrationFlow templateSourceFlow) {
return IntegrationFlows.from(templateSourceFlow)
return IntegrationFlow.from(templateSourceFlow)
.<String, String>transform(String::toUpperCase)
.channel(c -> c.queue("compositionMainFlowResult"))
.get();
@@ -196,7 +195,7 @@ public class IntegrationFlowCompositionTests {
@Bean
IntegrationFlow middleFlow(IntegrationFlow firstFlow, IntegrationFlow lastFlow) {
return IntegrationFlows.from(firstFlow)
return IntegrationFlow.from(firstFlow)
.<String, String>transform(p -> p + ", and middle flow")
.to(lastFlow);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 the original author or authors.
* Copyright 2016-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.
@@ -39,7 +39,6 @@ import org.springframework.integration.aggregator.HeaderAttributeCorrelationStra
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.dsl.MessageChannelSpec;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.dsl.Transformers;
@@ -249,7 +248,7 @@ public class CorrelationHandlerTests {
@Bean
public IntegrationFlow splitAggregateFlow() {
return IntegrationFlows.from("splitAggregateInput", true)
return IntegrationFlow.from("splitAggregateInput", true)
.transform(Transformers.toJson(ObjectToJsonTransformer.ResultType.NODE))
.split((splitter) -> splitter
.discardFlow((subFlow) -> subFlow.channel((c) -> c.queue("discardChannel"))))
@@ -312,7 +311,7 @@ public class CorrelationHandlerTests {
@Bean
public IntegrationFlow releaseBarrierFlow(MessageTriggerAction barrierTriggerAction) {
return IntegrationFlows.from(releaseChannel())
return IntegrationFlow.from(releaseChannel())
.trigger(barrierTriggerAction,
e -> e.poller(p -> p.fixedDelay(100)))
.get();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 the original author or authors.
* Copyright 2016-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.
@@ -60,7 +60,6 @@ import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.context.IntegrationContextUtils;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.dsl.Pollers;
import org.springframework.integration.dsl.Transformers;
@@ -570,7 +569,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow supplierFlow() {
return IntegrationFlows.fromSupplier(stringSupplier(), c -> c.id("stringSupplierEndpoint"))
return IntegrationFlow.fromSupplier(stringSupplier(), c -> c.id("stringSupplierEndpoint"))
.transform(toUpperCaseFunction())
.channel("suppliedChannel")
.get();
@@ -602,7 +601,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow supplierFlow2() {
return IntegrationFlows.fromSupplier(() -> "foo",
return IntegrationFlow.fromSupplier(() -> "foo",
c -> c.poller(Pollers.fixedDelay(100).maxMessagesPerPoll(1)))
.<String, String>transform(String::toUpperCase)
.channel("suppliedChannel2")
@@ -622,7 +621,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow controlBusFlow() {
return IntegrationFlows.from(ControlBusGateway.class, (gateway) -> gateway.beanName("controlBusGateway"))
return IntegrationFlow.from(ControlBusGateway.class, (gateway) -> gateway.beanName("controlBusGateway"))
.controlBus((endpoint) -> endpoint.id("controlBus"))
.get();
}
@@ -661,7 +660,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow flow2() {
return IntegrationFlows.from(this.inputChannel)
return IntegrationFlow.from(this.inputChannel)
.filter(p -> p instanceof String, e -> e
.id("filter")
.discardFlow(df -> df
@@ -715,7 +714,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow wireTapFlow1() {
return IntegrationFlows.from("tappedChannel1")
return IntegrationFlow.from("tappedChannel1")
.wireTap("tapChannel", wt -> wt.selector(m -> m.getPayload().equals("foo")))
.handle(new ReactiveMessageHandlerAdapter((message) -> Mono.just(message).log().then()))
.get();
@@ -738,7 +737,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow wireTapFlow4() {
return IntegrationFlows.from("tappedChannel4")
return IntegrationFlow.from("tappedChannel4")
.wireTap(tapChannel())
.channel("nullChannel")
.get();
@@ -792,14 +791,14 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow bridgeFlow() {
return IntegrationFlows.from(MessageChannels.queue("bridgeFlowInput"))
return IntegrationFlow.from(MessageChannels.queue("bridgeFlowInput"))
.channel(MessageChannels.queue("bridgeFlowOutput"))
.get();
}
@Bean
public IntegrationFlow bridgeFlow2() {
return IntegrationFlows.from("bridgeFlow2Input")
return IntegrationFlow.from("bridgeFlow2Input")
.bridge(c -> c.autoStartup(false).id("bridge"))
.fixedSubscriberChannel()
.delay("delayer", d -> d
@@ -817,7 +816,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow claimCheckFlow() {
return IntegrationFlows.from("claimCheckInput")
return IntegrationFlow.from("claimCheckInput")
.claimCheckIn(this.messageStore())
.claimCheckOut(this.messageStore())
.get();
@@ -851,14 +850,14 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow methodInvokingFlow() {
return IntegrationFlows.from("methodInvokingInput")
return IntegrationFlow.from("methodInvokingInput")
.handle(this.greetingService)
.get();
}
@Bean
public IntegrationFlow lambdasFlow() {
return IntegrationFlows.from("lambdasInput")
return IntegrationFlow.from("lambdasInput")
.filter(String.class, "World"::equals)
.transform(String.class, "Hello "::concat)
.get();
@@ -866,7 +865,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow errorRecovererFlow() {
return IntegrationFlows.from(Function.class, (gateway) -> gateway.beanName("errorRecovererFunction"))
return IntegrationFlow.from(Function.class, (gateway) -> gateway.beanName("errorRecovererFunction"))
.<Object>handle((p, h) -> {
throw new RuntimeException("intentional");
},
@@ -888,7 +887,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow recoveryFlow() {
return IntegrationFlows.from(recoveryChannel())
return IntegrationFlow.from(recoveryChannel())
.<MessagingException, Message<?>>transform(MessagingException::getFailedMessage)
.get();
@@ -896,7 +895,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow dedicatedPollingThreadFlow() {
return IntegrationFlows.from(MessageChannels.queue("dedicatedQueueChannel"))
return IntegrationFlow.from(MessageChannels.queue("dedicatedQueueChannel"))
.bridge(e -> e
.poller(Pollers.fixedDelay(0).receiveTimeout(-1))
.taskScheduler(dedicatedTaskScheduler()))
@@ -912,7 +911,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow flowWithNullChannel() {
return IntegrationFlows.from("flowWithNullChannelInput")
return IntegrationFlow.from("flowWithNullChannelInput")
.nullChannel();
}
@@ -948,7 +947,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow globalErrorChannelResolutionFlow(@Qualifier("taskScheduler") TaskExecutor taskExecutor) {
return IntegrationFlows.from(Consumer.class,
return IntegrationFlow.from(Consumer.class,
(gateway) -> gateway.beanName("globalErrorChannelResolutionFunction"))
.channel(c -> c.executor(taskExecutor))
.handle((p, h) -> {
@@ -969,7 +968,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow interceptorFlow(List<String> outputStringList) {
return IntegrationFlows.from("interceptorChannelIn")
return IntegrationFlow.from("interceptorChannelIn")
.intercept(new ChannelInterceptor() {
@Override
@@ -1029,7 +1028,7 @@ public class IntegrationFlowTests {
@Bean
public IntegrationFlow wrongLastComponent() {
return IntegrationFlows.from(MessageChannels.direct())
return IntegrationFlow.from(MessageChannels.direct())
.fixedSubscriberChannel()
.get();
}

View File

@@ -48,7 +48,6 @@ import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlowAdapter;
import org.springframework.integration.dsl.IntegrationFlowDefinition;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.handler.LoggingHandler;
import org.springframework.integration.support.MessageBuilder;
@@ -132,7 +131,7 @@ public class FlowServiceTests {
@Bean
public IntegrationFlow subFlow() {
return IntegrationFlows
return IntegrationFlow
.from("processChannel")
.<String, String>transform(String::toUpperCase)
.channel("replyChannel")

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 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.
@@ -39,7 +39,6 @@ import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.core.MessagingTemplate;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.gateway.GatewayProxyFactoryBean;
import org.springframework.integration.gateway.MessagingGatewaySupport;
@@ -174,7 +173,7 @@ public class GatewayDslTests {
@Bean
public IntegrationFlow gatewayFlow() {
return IntegrationFlows.from("gatewayInput")
return IntegrationFlow.from("gatewayInput")
.gateway("gatewayRequest", g -> g.errorChannel("gatewayError").replyTimeout(10L))
.gateway((f) -> f.transform("From Gateway SubFlow: "::concat))
.get();
@@ -182,7 +181,7 @@ public class GatewayDslTests {
@Bean
public IntegrationFlow gatewayRequestFlow() {
return IntegrationFlows.from("gatewayRequest")
return IntegrationFlow.from("gatewayRequest")
.filter("foo"::equals, (f) -> f.throwExceptionOnRejection(true))
.<String, String>transform(String::toUpperCase)
.get();
@@ -207,7 +206,7 @@ public class GatewayDslTests {
@Bean
public IntegrationFlow functionGateway() {
return IntegrationFlows.from(MessageFunction.class,
return IntegrationFlow.from(MessageFunction.class,
(gateway) -> gateway
.header("gatewayMethod", MethodArgsHolder::getMethod)
.header("gatewayArgs", MethodArgsHolder::getArgs)
@@ -219,7 +218,7 @@ public class GatewayDslTests {
@Bean
public IntegrationFlow routingGatewayFlow() {
return IntegrationFlows.from(RoutingGateway.class,
return IntegrationFlow.from(RoutingGateway.class,
(gateway) -> gateway.beanName("routingGateway").header("gatewayMethod", MethodArgsHolder::getMethod))
.route(Message.class, (message) ->
message.getHeaders().get("gatewayMethod", Method.class).getName(),

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 the original author or authors.
* Copyright 2016-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.
@@ -62,7 +62,6 @@ import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlowAdapter;
import org.springframework.integration.dsl.IntegrationFlowBuilder;
import org.springframework.integration.dsl.IntegrationFlowDefinition;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.dsl.MessageProducerSpec;
import org.springframework.integration.dsl.StandardIntegrationFlow;
@@ -131,7 +130,7 @@ public class ManualFlowTests {
};
QueueChannel channel = new QueueChannel();
channel.setBeanName("channel");
IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(producer);
IntegrationFlowBuilder flowBuilder = IntegrationFlow.from(producer);
BridgeHandler bridgeHandler = new BridgeHandler();
bridgeHandler.setBeanName("bridge");
@@ -175,7 +174,7 @@ public class ManualFlowTests {
}
MyProducerSpec spec = new MyProducerSpec(new MyProducer());
QueueChannel channel = new QueueChannel();
IntegrationFlow flow = IntegrationFlows.from(spec.id("fooChannel"))
IntegrationFlow flow = IntegrationFlow.from(spec.id("fooChannel"))
.channel(channel)
.get();
IntegrationFlowRegistration flowRegistration = this.integrationFlowContext.registration(flow).register();
@@ -396,7 +395,7 @@ public class ManualFlowTests {
QueueChannel resultChannel = new QueueChannel();
IntegrationFlow integrationFlow = IntegrationFlows
IntegrationFlow integrationFlow = IntegrationFlow
.from(messageFlux)
.<Integer, Boolean>route(p -> p % 2 == 0, m -> m
.subFlowMapping(true, sf -> sf.<Integer, String>transform(em -> "even:" + em))
@@ -426,7 +425,7 @@ public class ManualFlowTests {
String testId = "testId";
StandardIntegrationFlow testFlow =
IntegrationFlows.from(Supplier.class)
IntegrationFlow.from(Supplier.class)
.get();
IntegrationFlowRegistration flowRegistration =

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 the original author or authors.
* Copyright 2016-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.
@@ -43,7 +43,6 @@ import org.springframework.integration.IntegrationMessageHeaderAccessor;
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.dsl.MessageChannels;
import org.springframework.integration.dsl.context.IntegrationFlowContext;
import org.springframework.integration.endpoint.AbstractEndpoint;
@@ -173,7 +172,7 @@ public class ReactiveStreamsTests {
QueueChannel resultChannel = new QueueChannel();
IntegrationFlow integrationFlow =
IntegrationFlows.from(messageFlux)
IntegrationFlow.from(messageFlux)
.<Integer, Integer>transform(p -> p * 2)
.channel(resultChannel)
.get();
@@ -250,7 +249,7 @@ public class ReactiveStreamsTests {
@Bean
public Publisher<Message<String>> reactiveFlow() {
return IntegrationFlows
return IntegrationFlow
.from(() -> new GenericMessage<>("a,b,c,d,e,f"),
e -> e.poller(p -> p.trigger(ctx -> this.invoked.getAndSet(true) ? null : new Date()))
.id("reactiveStreamsMessageSource"))
@@ -261,7 +260,7 @@ public class ReactiveStreamsTests {
@Bean
public Publisher<Message<Integer>> pollableReactiveFlow() {
return IntegrationFlows
return IntegrationFlow
.from("inputChannel")
.split(s -> s.delimiters(","))
.<String, Integer>transform(Integer::parseInt,
@@ -273,7 +272,7 @@ public class ReactiveStreamsTests {
@Bean
public Publisher<Message<String>> singleChannelFlow() {
return IntegrationFlows
return IntegrationFlow
.from(MessageChannels.direct("singleChannel"))
.log()
.toReactivePublisher();
@@ -281,7 +280,7 @@ public class ReactiveStreamsTests {
@Bean
public Publisher<Message<String>> fixedSubscriberChannelFlow() {
return IntegrationFlows
return IntegrationFlow
.from("fixedSubscriberChannel", true)
.log()
.toReactivePublisher();

View File

@@ -44,7 +44,6 @@ import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.config.EnableMessageHistory;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlowDefinition;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.expression.FunctionExpression;
import org.springframework.integration.store.MessageGroup;
@@ -639,7 +638,7 @@ public class RouterTests {
@Bean
public IntegrationFlow routeFlow() {
return IntegrationFlows.from("routerInput")
return IntegrationFlow.from("routerInput")
.<Integer, Boolean>route(p -> p % 2 == 0,
m -> m.channelMapping(true, evenChannel())
.subFlowMapping(false, f ->
@@ -702,7 +701,7 @@ public class RouterTests {
@Bean
public IntegrationFlow recipientListFlow() {
return IntegrationFlows.from("recipientListInput")
return IntegrationFlow.from("recipientListInput")
.<String, String>transform(p -> p.replaceFirst("Payload", ""))
.routeToRecipients(r -> r
.recipient("foo-channel", "'foo' == payload")
@@ -729,14 +728,14 @@ public class RouterTests {
@Bean
public IntegrationFlow routeMethodInvocationFlow() {
return IntegrationFlows.from("routerMethodInput")
return IntegrationFlow.from("routerMethodInput")
.route("routingTestBean", "routeMessage")
.get();
}
@Bean
public IntegrationFlow routeMethodInvocationFlow2() {
return IntegrationFlows.from("routerMethod2Input")
return IntegrationFlow.from("routerMethod2Input")
.route(new RoutingTestBean())
.get();
}
@@ -748,7 +747,7 @@ public class RouterTests {
@Bean
public IntegrationFlow routeMultiMethodInvocationFlow() {
return IntegrationFlows.from("routerMultiInput")
return IntegrationFlow.from("routerMultiInput")
.route(String.class, p -> p.equals("foo") || p.equals("bar")
? new String[]{ "foo", "bar" }
: null,
@@ -918,7 +917,7 @@ public class RouterTests {
@Bean
public IntegrationFlow propagateErrorFromGatherer(TaskExecutor taskExecutor) {
return IntegrationFlows.from(Function.class)
return IntegrationFlow.from(Function.class)
.scatterGather(s -> s
.recipientFlow(subFlow -> subFlow
.channel(c -> c.executor(taskExecutor))

View File

@@ -38,7 +38,6 @@ import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.codec.Codec;
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.integration.dsl.Transformers;
import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
@@ -288,7 +287,7 @@ public class TransformerTests {
@Bean
public IntegrationFlow enricherFlow() {
return IntegrationFlows.from("enricherInput", true)
return IntegrationFlow.from("enricherInput", true)
.enrich(e -> e.requestChannel("enrichChannel")
.errorChannel(enricherErrorChannel())
.requestPayloadExpression("payload")
@@ -303,7 +302,7 @@ public class TransformerTests {
@Bean
public IntegrationFlow enricherFlow2() {
return IntegrationFlows.from("enricherInput2", true)
return IntegrationFlow.from("enricherInput2", true)
.enrich(e -> e.requestChannel("enrichChannel")
.requestPayloadExpression("payload")
.shouldClonePayload(false)
@@ -315,7 +314,7 @@ public class TransformerTests {
@Bean
public IntegrationFlow enricherFlow3() {
return IntegrationFlows.from("enricherInput3", true)
return IntegrationFlow.from("enricherInput3", true)
.enrich(e -> e.requestChannel("enrichChannel")
.requestPayload(Message::getPayload)
.shouldClonePayload(false)
@@ -325,7 +324,7 @@ public class TransformerTests {
@Bean
public IntegrationFlow enrichFlow() {
return IntegrationFlows.from("enrichChannel")
return IntegrationFlow.from("enrichChannel")
.<TestPojo, Map<?, ?>>transform(p -> {
if ("junk".equals(p.getName())) {
throw new RuntimeException("intentional");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-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.
@@ -35,7 +35,6 @@ import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
@@ -108,7 +107,7 @@ public class ContentTypeConversionTests {
@Bean
public IntegrationFlow serviceFlow() {
return IntegrationFlows.from(ServiceGateway.class)
return IntegrationFlow.from(ServiceGateway.class)
.channel("serviceChannel")
.handle(this)
.get();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2020 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.
@@ -42,7 +42,6 @@ import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.config.EnableIntegrationManagement;
import org.springframework.integration.core.MessageSource;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.endpoint.AbstractMessageSource;
import org.springframework.integration.gateway.GatewayProxyFactoryBean;
import org.springframework.integration.gateway.MessagingGatewaySupport;
@@ -355,7 +354,7 @@ public class MicrometerMetricsTests {
@Bean
IntegrationFlow gatesFlow() {
return IntegrationFlows.from(Gate.class)
return IntegrationFlow.from(Gate.class)
.nullChannel();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019-2020 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.
@@ -33,7 +33,6 @@ import org.springframework.integration.channel.DirectChannel;
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.test.condition.LogLevels;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.integration.transformer.support.AvroHeaders;
@@ -166,7 +165,7 @@ public class AvroTests {
@Bean
public IntegrationFlow flow1() {
return IntegrationFlows.from(in1())
return IntegrationFlow.from(in1())
.transform(new SimpleToAvroTransformer())
.wireTap(tapped())
.transform(fromTransformer())
@@ -177,7 +176,7 @@ public class AvroTests {
@Bean
public IntegrationFlow flow2() {
return IntegrationFlows.from(in2())
return IntegrationFlow.from(in2())
.transform(new SimpleToAvroTransformer())
.wireTap(tapped())
.enrichHeaders(h -> h.header(AvroHeaders.TYPE, AvroTestClass2.class, true))
@@ -189,7 +188,7 @@ public class AvroTests {
@Bean
public IntegrationFlow flow3() {
return IntegrationFlows.from(in3())
return IntegrationFlow.from(in3())
.transform(new SimpleToAvroTransformer())
.wireTap(tapped())
.enrichHeaders(h -> h.header(AvroHeaders.TYPE, AvroTestClass2.class.getName(), true))
@@ -201,7 +200,7 @@ public class AvroTests {
@Bean
public IntegrationFlow flow4() {
return IntegrationFlows.from(in4())
return IntegrationFlow.from(in4())
.transform(new SimpleToAvroTransformer())
.wireTap(tapped())
.enrichHeaders(h -> h.header(AvroHeaders.TYPE, null, true)
@@ -214,7 +213,7 @@ public class AvroTests {
@Bean
public IntegrationFlow flow5() {
return IntegrationFlows.from(in5())
return IntegrationFlow.from(in5())
.transform(new SimpleToAvroTransformer().typeExpression("'avroTest'"))
.wireTap(tapped())
.transform(new SimpleFromAvroTransformer(AvroTestClass1.class)
@@ -227,7 +226,7 @@ public class AvroTests {
@Bean
public IntegrationFlow flow6() {
return IntegrationFlows.from(in6())
return IntegrationFlow.from(in6())
.transform(new SimpleToAvroTransformer().typeExpression("'wontFindThisHeader'"))
.wireTap(tapped())
.transform(new SimpleFromAvroTransformer(AvroTestClass1.class)