latch.await();
if (!channelFuture.isSuccess()) {
// clear channel as we did not connect
channel = null;
throw new CamelException("Cannot connect to " + configuration.getAddress(), channelFuture.getCause());
}
channel = channelFuture.getChannel();
// to keep track of all channels in use
ALL_CHANNELS.add(channel);