Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pcan/0f79bd7a8670ce5a28add1e26b6ed5e6 to your computer and use it in GitHub Desktop.
Save pcan/0f79bd7a8670ce5a28add1e26b6ed5e6 to your computer and use it in GitHub Desktop.
Create a Spring Integration Channel programatically and register that as a Spring bean
private SubscribableChannel createInputChannel(String inputChannelName) {
PublishSubscribeChannel channel = new PublishSubscribeChannel();
channel.setBeanName(inputChannelName);
channel.setBeanFactory(applicationContext);
//channel.setApplySequence(true);
((ConfigurableApplicationContext)applicationContext).getBeanFactory().registerSingleton(inputChannelName, channel);
return channel;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment