Sebastian Lore
Sebastian Lore

Reputation: 469

Dynamically load IntegrationFlow

Is is possible to load SI flow definitions at runtime? I know I can do something like @ImportResource("/integration/integration.xml") and it will load the definitions at startup. The question is: can I load such files at runtime? If yes, how?

Upvotes: 0

Views: 304

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121262

The recommended modern way to do that is exactly about an IntegrationFlow and Java DSL. See more info in the docs: https://docs.spring.io/spring-integration/docs/current/reference/html/dsl.html#java-dsl-runtime-flows

If you still stuck with XML configuration, you probably need to take a look into this extension: https://github.com/spring-projects/spring-integration-flow

If that is not enough, you may do something like GenericXmlApplicationContext and point to your XML config. Also see its setParent(ApplicationContext) if you need relationship with the current application context.

Upvotes: 1

Related Questions