Actually <int:channel>
produces DirectChannel
bean.
And if you want to do it programatically and have entire Messaging Infrastructure you should configure it as bean anyway:
@Configuration
public class MyConfiguration {
@Bean
public MessageChannel sample() {
return new DirectChannel();
}
}
The id
attribute is a key feature of Spring IOC container and, of course, it isn't responcibility of concrete class.
Seems to me you should to take a look into the new stuff of Spring Integration 4.0.