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
Copy file name to clipboardExpand all lines: spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java
Copy file name to clipboardExpand all lines: src/reference/asciidoc/configuration.adoc
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -315,8 +315,7 @@ public class ThingService {
315
315
====
316
316
317
317
NOTE: The value of the annotation can also be a SpEL expression (for example, `someHeader.toUpperCase()`), which is useful when you wish to manipulate the header value before injecting it.
318
-
It also provides an optional `required` property, which specifies whether the attribute value must be available within
319
-
the headers.
318
+
It also provides an optional `required` property, which specifies whether the attribute value must be available within the headers.
320
319
The default value for the `required` property is `true`.
321
320
322
321
For several of these annotations, when a message-handling method returns a non-null value, the endpoint tries to send a reply.
@@ -345,8 +344,9 @@ public class ThingService {
345
344
346
345
The processing of these annotations creates the same beans as the corresponding XML components -- `AbstractEndpoint` instances and `MessageHandler` instances (or `MessageSource` instances for the inbound channel adapter).
347
346
See <<annotations_on_beans>>.
348
-
The bean names are generated from the following pattern: `[componentName].[methodName].[decapitalizedAnnotationClassShortName]`
349
-
(for example, for the preceding example the bean name is `thingService.otherThing.serviceActivator`) for the `AbstractEndpoint` and the same name with an additional `.handler` (`.source`) suffix for the `MessageHandler` (`MessageSource`) bean.
347
+
The bean names are generated from the following pattern: `[componentName].[methodName].[decapitalizedAnnotationClassShortName]`.
348
+
In the preceding example the bean name is `thingService.otherThing.serviceActivator` for the `AbstractEndpoint` and the same name with an additional `.handler` (`.source`) suffix for the `MessageHandler` (`MessageSource`) bean.
349
+
Such a name can be customized using an `@EndpointId` annotation alongside with these messaging annotations.
350
350
The `MessageHandler` instances (`MessageSource` instances) are also eligible to be tracked by <<./message-history.adoc#message-history,the message history>>.
351
351
352
352
Starting with version 4.0, all messaging annotations provide `SmartLifecycle` options (`autoStartup` and `phase`) to allow endpoint lifecycle control on application context initialization.
@@ -355,6 +355,8 @@ To change the state of an endpoint (such as ` start()` or `stop()`), you can obt
355
355
Alternatively, you can send a command message to the `Control Bus` (see <<./control-bus.adoc#control-bus,Control Bus>>).
356
356
For these purposes, you should use the `beanName` mentioned earlier in the preceding paragraph.
357
357
358
+
IMPORTANT: The auto-created channels after parsing the mentioned annotations (when no specific bean is configured) and also created internally consumer endpoints can be autowired in other services, but they have to be marked with `@Lazy` annotation - they are registered in the application context context later than regular bean definitions parsing phase.
Copy file name to clipboardExpand all lines: src/reference/asciidoc/overview.adoc
+7-12Lines changed: 7 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -136,8 +136,7 @@ The chapters that follow elaborate and provide sample code as well as configurat
136
136
==== Message Transformer
137
137
138
138
A message transformer is responsible for converting a message's content or structure and returning the modified message.
139
-
Probably the most common type of transformer is one that converts the payload of the message from one format to another (such as
140
-
from XML to `java.lang.String`).
139
+
Probably the most common type of transformer is one that converts the payload of the message from one format to another (such as from XML to `java.lang.String`).
141
140
Similarly, a transformer can add, remove, or modify the message's header values.
142
141
143
142
[[overview-endpoints-filter]]
@@ -213,7 +212,7 @@ Spring Integration provides a number of channel adapters, which are described in
213
212
.An inbound channel adapter endpoint connects a source system to a `MessageChannel`.
NOTE: Message sources can be pollable (for example, POP3) or message-driven_ (for example, IMAP Idle).
215
+
NOTE: Message sources can be pollable (for example, POP3) or message-driven (for example, IMAP Idle).
217
216
In the preceding diagram, this is depicted by the "`clock`" symbol and the solid arrow (poll) and the dotted arrow (message-driven).
218
217
219
218
.An outbound channel adapter endpoint connects a `MessageChannel` to a target system.
@@ -294,7 +293,7 @@ Consider the following example of an annotated bean:
294
293
====
295
294
[source, java]
296
295
----
297
-
@Configuratiom
296
+
@Configuration
298
297
public class SomeConfiguration {
299
298
300
299
@Bean
@@ -317,7 +316,7 @@ Starting with version 5.0.4, you can modify these names by using the `@EndpointI
317
316
====
318
317
[source, java]
319
318
----
320
-
@Configuratiom
319
+
@Configuration
321
320
public class SomeConfiguration {
322
321
323
322
@Bean("someService.handler") <1>
@@ -405,13 +404,10 @@ For example, many endpoints consist of a `MessageHandler` bean and a `ConsumerEn
405
404
406
405
The first time a Spring Integration namespace element is encountered, the framework automatically declares a number of beans (a task scheduler, an implicit channel creator, and others) that are used to support the runtime environment.
407
406
408
-
IMPORTANT: Version 4.0 introduced the `@EnableIntegration` annotation, to allow the
409
-
registration of Spring Integration infrastructure beans (see the
IMPORTANT: Version 4.0 introduced the `@EnableIntegration` annotation, to allow the registration of Spring Integration infrastructure beans (see the https://docs.spring.io/spring-integration/docs/latest-ga/api/org/springframework/integration/config/EnableIntegration.html[Javadoc]).
411
408
This annotation is required when only Java configuration is used -- for example with Spring Boot or Spring Integration Messaging Annotation support and Spring Integration Java DSL with no XML integration configuration.
412
409
413
-
The `@EnableIntegration` annotation is also useful when you have a parent context with no Spring Integration components
414
-
and two or more child contexts that use Spring Integration.
410
+
The `@EnableIntegration` annotation is also useful when you have a parent context with no Spring Integration components and two or more child contexts that use Spring Integration.
415
411
It lets these common components be declared once only, in the parent context.
416
412
417
413
The `@EnableIntegration` annotation registers many infrastructure components with the application context.
@@ -605,8 +601,7 @@ Its main implementations are:
605
601
When you use messaging annotations or the Java DSL, you need to worry about these components, because the Framework automatically produces them with appropriate annotations and `BeanPostProcessor` implementations.
606
602
When building components manually, you should use the `ConsumerEndpointFactoryBean` to help determine the target `AbstractEndpoint` consumer implementation to create, based on the provided `inputChannel` property.
607
603
608
-
On the other hand, the `ConsumerEndpointFactoryBean` delegates to an another first class citizen in the Framework:
609
-
`org.springframework.messaging.MessageHandler`.
604
+
On the other hand, the `ConsumerEndpointFactoryBean` delegates to an another first class citizen in the Framework - `org.springframework.messaging.MessageHandler`.
610
605
The goal of the implementation of this interface is to handle the message consumed by the endpoint from the channel.
611
606
All EIP components in Spring Integration are `MessageHandler` implementations (for example, `AggregatingMessageHandler`, `MessageTransformingHandler`, `AbstractMessageSplitter`, and others).
612
607
The target protocol outbound adapters (`FileWritingMessageHandler`, `HttpRequestExecutingMessageHandler`, `AbstractMqttMessageHandler`, and others) are also `MessageHandler` implementations.
0 commit comments