Kamil Roman
Kamil Roman

Reputation: 1071

Inbound channel adapter class override

Is there a way to override Spring Integration elements, preferably in XML? I have a JMS inbound-channel-adapter which on some environments I would like to switch to a File adapter. I tried overriding the bean definition with a profile-based import at the end of the XML context file, but it seems that instead of overriding both endpoints are started.

Upvotes: 0

Views: 144

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121177

If you deal with an XML configuration, there is just enough to have those different channel adapters in their own configuration files with a profile on a root <beans> tag: https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-definition-profiles-xml.

Both your channel adapters can point to the same channel declared in some other common config. Then you combine all of them in the main config via <import> and only those satisfying to the active profile are going to be activated on the configuration phase.

Upvotes: 1

Related Questions