GH-3320: Refine lifecycle control in StdIntFlow (#3322)
* GH-3320: Refine lifecycle control in StdIntFlow Fixes https://github.com/spring-projects/spring-integration/issues/3320 Turns out that lifecycle control for the whole bunch of components in one `IntegrationFlow` is useful in fields. * Change the logic in the `StandardIntegrationFlow` to let to call `start()` and `stop()` independently how the flow was registered in the application context. This way it can be autowired as a `Lifecycle` to let end-user to avoid the search for proper component in the flow to stop or start manually - all the components registered with the flow are going to be stopped or started respectively * * Add `this.` to class property usage to satisfy Checkstyle Co-authored-by: Artem Bilan <abilan@vmware.com>
This commit is contained in:
@@ -75,6 +75,7 @@ The following list includes the common DSL method names and the associated EIP e
|
||||
Conceptually, integration processes are constructed by composing these endpoints into one or more message flows.
|
||||
Note that EIP does not formally define the term 'message flow', but it is useful to think of it as a unit of work that uses well known messaging patterns.
|
||||
The DSL provides an `IntegrationFlow` component to define a composition of channels and endpoints between them, but now `IntegrationFlow` plays only the configuration role to populate real beans in the application context and is not used at runtime.
|
||||
However the bean for `IntegrationFlow` can be autowired as a `Lifecycle` to control `start()` and `stop()` for the whole flow which is delegated to all the Spring Integration components associated with this `IntegrationFlow`.
|
||||
The following example uses the `IntegrationFlows` factory to define an `IntegrationFlow` bean by using EIP-methods from `IntegrationFlowBuilder`:
|
||||
|
||||
====
|
||||
|
||||
Reference in New Issue
Block a user