Reputation: 57
Recently, I was trying to build a rest service to create, start and stop an integration flow (which was reading an RSS feed and printing on console), and I was able to achieve that.
But my next requirement was to get status (maybe like, running, stopped, stopped with exception) from the already running flow, and I was unable to do that, I cannot see any method related to that in "IntegrationFlowRegistration".
Also, is there a way to store "IntegrationFlow" in RDBMS like MySql, etc?
Upvotes: 1
Views: 487
Reputation: 121177
Well, the flow by itself is just a logical container for components it connects. Even though we really can get somehow access to all those components in one IntegrationFlow
, that doesn't mean that your whole solution contains only one IntegrationFlow
. It is fully normal to connect components from different IntegrationFlow
s since at runtime they are fully not related to the IntegrationFlow
created them. Those runtime components are identical after any configuration parsing we have in the framework: XML, Java DSL, Kotlin DSL or just plain Java & Annotation configuration. You even can create all the beans manually and still at runtime it is going to be an EIP solution.
What I'm trying to say that it is wrong to try to find a solution for the whole flow state. Or you should consult some individual component (e.g. the mentioned RSS one), or you should have some separate component to track such a custom state.
See Lifecycle
contract. Most of Spring Integration implements it, so you can check its isRunning()
whenever you need. In fact even a StandardIntegrationFlow
implement this one, but you should not fully rely on it because your final solution might consist from several flows or many independent components.
There is no anything like stopped with exception
- we don't stop components because of an error. Instead you can enable metrics and check channel or handlers success
and failure
send counts: https://docs.spring.io/spring-integration/docs/5.3.0.RELEASE/reference/html/system-management.html#metrics-management
Upvotes: 1