@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
Object in = msg;
if (LOG.isDebugEnabled()) {
LOG.debug("Channel: {} received body: {}", ctx.channel(), in);
}
final Exchange exchange = consumer.getEndpoint().createExchange(ctx, msg);
if (consumer.getConfiguration().isSync()) {
exchange.setPattern(ExchangePattern.InOut);
}
if (consumer.getConfiguration().getCharsetName() != null) {
exchange.setProperty(Exchange.CHARSET_NAME, IOHelper.normalizeCharset(consumer.getConfiguration().getCharsetName()));
}
if (consumer.getConfiguration().isReuseChannel()) {
exchange.setProperty(NettyConstants.NETTY_CHANNEL, ctx.channel());
}
consumer.createUoW(exchange);
beforeProcess(exchange, ctx, msg);
if (consumer.getEndpoint().isSynchronous()) {
processSynchronously(exchange, ctx, msg);
} else {
processAsynchronously(exchange, ctx, msg);
}
}