可以在运行时加载SI流定义吗?我知道我可以做一些像@ImportResource("/integration/integration.xml")这样的事情,它会在启动时加载定义。问题是:我可以在运行时加载这样的文件吗?如果是,是如何实现的?
发布于 2020-12-02 01:02:46
推荐的现代方法就是使用IntegrationFlow和Java DSL。在文档中查看更多信息:https://docs.spring.io/spring-integration/docs/current/reference/html/dsl.html#java-dsl-runtime-flows
如果您仍然坚持使用XML配置,那么您可能需要研究一下这个扩展:https://github.com/spring-projects/spring-integration-flow
如果这还不够,您可以执行类似GenericXmlApplicationContext的操作,并指向您的XML配置。如果您需要与当前应用程序上下文建立关系,也可以查看它的setParent(ApplicationContext)。
https://stackoverflow.com/questions/65094860
复制相似问题