I'm sorry, I don't mention it rightly. NettyProducer closes all the open channels when it is stopped. context.stop will shutdown the routes, consumers and producers.
If you don't want to shutdown the CamelContext to close the channel, you can set the option disconnect to be true. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 11, 2013 at 1:57 PM, ignos wrote: > Thanks. > > I edit the source. > > SpringCamelContext context = (SpringCamelContext) > applicationContext.getBean(contextId); > context.start(); > ProducerTemplate template = context.createProducerTemplate(); > template.sendBody(endPoint, message); > context.stop(); > > "context.stop()" works the way I want it to. > > There is something I have been curious about. > What's the difference between context.stop() and template.stop()? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-do-I-close-Netty-connections-and-shutdown-my-application-gracefully-tp5735496p5735504.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).