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
@@ -649,8 +649,9 @@ Starting with version 5.1, this kind of `IntegrationFlow` is wrapped to the prox
649
649
650
650
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.
651
651
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`.
652
-
The `Transformer` implementation bean for that endpoint has a bean name of `lambdaFlow.o.s.i.transformer.MethodInvokingTransformer#0`.
653
-
(In both cases, `o.s.i` is `org.springframework.integration`, shortened here to fit on the page.)
652
+
(The `o.s.i` is a shortened from `org.springframework.integration` to fit on the page.)
653
+
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.
654
+
The same pattern is applied for all the `NamedComponent` s when the bean name has to be generated within the flow.
654
655
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.
655
656
See <<java-dsl-runtime-flows>> for more information.
656
657
@@ -661,12 +662,14 @@ We introduced the `FunctionExpression` class (an implementation of SpEL's `Expre
661
662
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.
662
663
The following example shows how to use a function expression:
663
664
665
+
====
664
666
[source,java]
665
667
----
666
668
.enrich(e -> e.requestChannel("enrichChannel")
667
669
.requestPayload(Message::getPayload)
668
670
.propertyFunction("date", m -> new Date()))
669
671
----
672
+
====
670
673
671
674
The `FunctionExpression` also supports runtime type conversion, as is done in `SpelExpression`.
672
675
@@ -676,6 +679,7 @@ The `FunctionExpression` also supports runtime type conversion, as is done in `S
676
679
Some of `if...else` and `publish-subscribe` components provide the ability to specify their logic or mapping by using sub-flows.
677
680
The simplest sample is `.publishSubscribeChannel()`, as the following example shows:
678
681
682
+
====
679
683
[source,java]
680
684
----
681
685
@Bean
@@ -692,8 +696,10 @@ public IntegrationFlow subscribersFlow() {
692
696
.channel(c -> c.queue("subscriber3Results"));
693
697
}
694
698
----
699
+
====
695
700
696
-
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.
701
+
You can achieve the same result with separate `IntegrationFlow` `@Bean` definitions, but we hope you find the sub-flow style of logic composition useful.
702
+
We find that it results in shorter (and so more readable) code.
697
703
698
704
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
@@ -36,6 +36,8 @@ The following changes have been made in version 5.1:
36
36
37
37
The `IntegrationFlowContext` is now an interface and `IntegrationFlowRegistration` is an inner interface of `IntegrationFlowContext`.
38
38
39
+
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