简体   繁体   中英

JSON or Pipe(|) based DSL for dynamic flow generation in Spring Integration

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..?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM