Roman Lebedev
Roman Lebedev

Reputation: 1013

Spring Integration runtime configuration

Is it possible to load Spring Integration application context and flows/integrations from some xml file? Stored in DB, for example?

Does Spring Integration address runtime deployment of new integrations / flows as xml, without applicaiton restart?

Or it is not the case for Spring integration and I should look at something other, like BPMN?

The only idea I currently have is to use FileSystemXmlApplicationContext to load new integrations/flow.

The problem I'm trying to solve is to allow add new integraions/flows dynamically at runtime without redeploy.

Upvotes: 0

Views: 200

Answers (1)

Gary Russell
Gary Russell

Reputation: 174809

You can load the new flows into an application context that is a child of the main context. It will have visibility to any beans in the parent context (but not vice-versa).

/**
 * Create a new ClassPathXmlApplicationContext with the given parent,
 * loading the definitions from the given XML files and automatically
 * refreshing the context.
 * @param configLocations array of resource locations
 * @param parent the parent context
 * @throws BeansException if context creation failed
 */
public ClassPathXmlApplicationContext(String[] configLocations, ApplicationContext parent) throws BeansException {
    this(configLocations, true, parent);
}

Upvotes: 1

Related Questions