protected void doStop() throws Exception {
LOG.debug("Stopping producer at address: {}", configuration.getAddress());
// close all channels
LOG.trace("Closing {} channels", ALL_CHANNELS.size());
ChannelGroupFuture future = ALL_CHANNELS.close();
future.awaitUninterruptibly();
// and then release other resources
if (channelFactory != null) {
channelFactory.releaseExternalResources();
}