protected void doStop() throws Exception {
LOG.debug("Stopping producer at address: {}", configuration.getAddress());
// close all channels
LOG.trace("Closing {} channels", allChannels.size());
ChannelGroupFuture future = allChannels.close();
future.awaitUninterruptibly();
// and then shutdown the thread pools
if (workerGroup != null) {
workerGroup.shutdownGracefully();
workerGroup = null;