You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JIRA: https://jira.spring.io/browse/INT-4480
For better readability of bean names, e.g. from the metrics collectors,
generate them from the component type instead of their fully qualified
class names
Copy file name to clipboardExpand all lines: spring-integration-core/src/main/java/org/springframework/integration/dsl/context/IntegrationFlowBeanPostProcessor.java
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -429,7 +429,14 @@ else if (fallbackId != null) {
Copy file name to clipboardExpand all lines: src/reference/asciidoc/dsl.adoc
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -650,8 +650,9 @@ Starting with version 5.1, this kind of `IntegrationFlow` is wrapped to the prox
650
650
651
651
Starting with version 5.0.6, the generated bean names for the components in an `IntegrationFlow` include the flow bean followed by a dot (`.`) as a prefix.
652
652
For example, the `ConsumerEndpointFactoryBean` for the `.transform("Hello "::concat)` in the preceding sample results in a bean name of `lambdaFlow.o.s.i.config.ConsumerEndpointFactoryBean#0`.
653
-
The `Transformer` implementation bean for that endpoint has a bean name of `lambdaFlow.o.s.i.transformer.MethodInvokingTransformer#0`.
654
-
(In both cases, `o.s.i` is `org.springframework.integration`, shortened here to fit on the page.)
653
+
(The `o.s.i` is a shortened from `org.springframework.integration` to fit on the page.)
654
+
The `Transformer` implementation bean for that endpoint has a bean name of `lambdaFlow.transformer#0` (starting with version 5.1), where instead of a fully qualified name of the `MethodInvokingTransformer` class, its component type is used.
655
+
The same pattern is applied for all the `NamedComponent` s when the bean name has to be generated within the flow.
655
656
These generated bean names are prepended with the flow ID for purposes such as parsing logs or grouping components together in some analysis tool, as well as to avoid a race condition when we concurrently register integration flows at runtime.
656
657
See <<java-dsl-runtime-flows>> for more information.
657
658
@@ -662,12 +663,14 @@ We introduced the `FunctionExpression` class (an implementation of SpEL's `Expre
662
663
The `Function<T, R>` option is provided for the DSL components, along with an `expression` option, when there is the implicit `Strategy` variant from Core Spring Integration.
663
664
The following example shows how to use a function expression:
664
665
666
+
====
665
667
[source,java]
666
668
----
667
669
.enrich(e -> e.requestChannel("enrichChannel")
668
670
.requestPayload(Message::getPayload)
669
671
.propertyFunction("date", m -> new Date()))
670
672
----
673
+
====
671
674
672
675
The `FunctionExpression` also supports runtime type conversion, as is done in `SpelExpression`.
673
676
@@ -677,6 +680,7 @@ The `FunctionExpression` also supports runtime type conversion, as is done in `S
677
680
Some of `if...else` and `publish-subscribe` components provide the ability to specify their logic or mapping by using sub-flows.
678
681
The simplest sample is `.publishSubscribeChannel()`, as the following example shows:
679
682
683
+
====
680
684
[source,java]
681
685
----
682
686
@Bean
@@ -693,8 +697,10 @@ public IntegrationFlow subscribersFlow() {
693
697
.channel(c -> c.queue("subscriber3Results"));
694
698
}
695
699
----
700
+
====
696
701
697
-
You can achieve the same result with separate `IntegrationFlow` `@Bean` definitions, but we hope you find the sub-flow style of logic composition useful. We find that it results in shorter (and so more readable) code.
702
+
You can achieve the same result with separate `IntegrationFlow` `@Bean` definitions, but we hope you find the sub-flow style of logic composition useful.
703
+
We find that it results in shorter (and so more readable) code.
698
704
699
705
A similar `publish-subscribe` sub-flow composition provides the `.routeToRecipients()` method.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/whats-new.adoc
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@ The `IntegrationFlowContext` is now an interface and `IntegrationFlowRegistratio
39
39
A new `logAndReply()` operator has been introduced for convenience when you wish to log at the end of a flow for request-reply configurations.
40
40
This avoid confusion with `log()` which is treated as a one-way end flow component.
41
41
42
+
A generated bean name for any `NamedComponent` within an integration flow is now based on the component type for better readability from visual tools, logs analyzers and metrics collectors.
0 commit comments