Skip to content

Instantly share code, notes, and snippets.

@arthurtsang
Created March 29, 2013 01:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save arthurtsang/5268129 to your computer and use it in GitHub Desktop.
Save arthurtsang/5268129 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