GH-3615: Make log() as non-terminal in DSL

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

The `log()` operator for Java DSL in the end of flow causes a confusion
for its different behavior and, therefore, inconsistency with expectations

* Populate a `bridge()` in the end of flow instead of `nullChannel` when
the current component is `WireTapSpec` (relevant to `wireTap()` and `log()`)
* Deprecate a `logAndReply()` operator since its behavior is now included into the `log()` in the end if flow
* Fix tests to use just `log()` in the end from now on
* Fix `dsl.adoc` for the new `log()` behaviour in the end of flow
This commit is contained in:
Artem Bilan
2022-04-07 14:38:59 -04:00
committed by Gary Russell
parent 802d217a9a
commit 10ea577549
5 changed files with 41 additions and 51 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-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.
@@ -82,7 +82,8 @@ public class IntegrationFlowExtensionTests {
.channel("innerChannel")
.customAggregate(customAggregatorSpec ->
customAggregatorSpec.expireGroupsUponCompletion(true))
.logAndReply();
.log()
.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.
@@ -127,7 +127,7 @@ public class FlowServiceTests {
@Bean
public IntegrationFlow testGateway() {
return f -> f.gateway("processChannel", g -> g.replyChannel("replyChannel"))
.logAndReply();
.log();
}
@Bean
@@ -152,7 +152,8 @@ public class FlowServiceTests {
.log(LoggingHandler.Level.ERROR, m -> {
resultOverLoggingHandler.set(m.getPayload());
return m;
});
})
.nullChannel();
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2021 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.
@@ -297,7 +297,8 @@ public class TransformerTests {
.propertyFunction("date", m -> new Date())
.headerExpression("foo", "payload['name']")
)
.logAndReply();
.log()
.get();
}
@Bean
@@ -463,7 +464,7 @@ public class TransformerTests {
throw new RuntimeException("intentional");
},
e -> e.advice(expressionAdvice()))
.logAndReply();
.log();
}
}