简体   繁体   English

JSON 或基于管道(|)的 DSL 用于 Spring 集成中的动态流生成

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

We are creating few SI flows using Java DSL.我们正在使用 Java DSL 创建几个 SI 流。 All flows are clubbed in a single Spring boot app, which makes us to redeploy the app every time whenever we add new flow.所有流都包含在单个 Spring 启动应用程序中,这使我们每次添加新流时都重新部署应用程序。 I was curios if somehow we abstract flow creation in a JSON format or a pipe delimited flow instruction.如果我们以 JSON 格式或 pipe 分隔流指令抽象流创建,我很好奇。 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:您的故事听起来更像 Spring Cloud Stream 和 Spring Cloud Data Flow 组合:

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

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

The solution similar to what you asking is possible with an XML configuration loaded at runtime.通过在运行时加载的 XML 配置,可以实现类似于您所要求的解决方案。 We have some old project (out of support at the moment) - Spring Integration Flow:我们有一些旧项目(目前不支持) - Spring 集成流程:

https://github.com/spring-projects/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.尽管您所问的最大问题是 Java 代码,用于您可能在这些动态流程中使用的组件。 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.因此,从一些流畅的外部配置加载动态流是不可能的,因为不清楚您将如何提供支持的 Java 代码。

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 .到目前为止,我们所拥有的是使用 Java DSL 的动态流: https://docs.spring.io/html-flows/#java-dsl/ But still it cannot be represented as some fancy JSON from outside.但它仍然不能从外部表示为一些花哨的 JSON。 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.它必须是一个应该被编译为分类的代码,然后我们才能在运行时将它们连接到集成流中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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