2

We are creating few SI flows using Java DSL. All flows are clubbed in a single Spring boot app, which makes us to redeploy the app every time whenever we add new flow. I was curios if somehow we abstract flow creation in a JSON format or a pipe delimited flow instruction. So that we can create flow dynamically and register it. I already tried to search regarding this and found nothing. Please guide me in the right direction to achieve it if it is possible..?

1 Answers1

2

Your story sounds more like Spring Cloud Stream and Spring Cloud Data Flow combination:

https://spring.io/projects/spring-cloud-stream

https://spring.io/projects/spring-cloud-dataflow

The solution similar to what you asking is possible with an XML configuration loaded at runtime. We have some old project (out of support at the moment) - Spring Integration Flow:

https://github.com/spring-projects/spring-integration-flow

Although the biggest problem with what you are asking is a Java code for components you may be use in those dynamic flows. So, loading a dynamic flows from some fluent external config is impossible since it is not clear how you going to provide the supporting Java code.

What we have so far is dynamic flows with Java DSL: https://docs.spring.io/spring-integration/docs/current/reference/html/dsl.html#java-dsl-runtime-flows. But still it cannot be represented as some fancy JSON from outside. It has to be a code which should be compiled to classed and only after that we can wire them up into integration flows at runtime.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • Thanks @Artem Bilan for your quick reply. Cloud flow seems a huge architecture change . XML config has given me hope but worried about its future support. I am curios why can't SI follow same approach as cloud flow ..? – Shankar Yadav Aug 10 '20 at 07:48
  • Considering each endpoint as stream and having custom logic in multiple custom service activators..? – Shankar Yadav Aug 10 '20 at 07:52