Skip to content

Instantly share code, notes, and snippets.

@semenodm
Last active December 7, 2015 21:51
Show Gist options
  • Select an option

  • Save semenodm/0e469a07335db10af3c1 to your computer and use it in GitHub Desktop.

Select an option

Save semenodm/0e469a07335db10af3c1 to your computer and use it in GitHub Desktop.
write body
// write body
NettyHelper.writeBodyAsync(LOG, channel, remoteAddress, body, exchange, new ChannelFutureListener() {
public void operationComplete(ChannelFuture channelFuture) throws Exception {
LOG.trace("Operation complete {}", channelFuture);
if (!channelFuture.isSuccess()) {
// no success then exit, (any exception has been handled by ClientChannelHandler#exceptionCaught)
return;
}
// if we do not expect any reply then signal callback to continue routing
if (!configuration.isSync()) {
try {
//some logic
} finally {
// signal callback to continue routing
producerCallback.done(false);
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment