Request(ChannelHandlerContext ctx, ByteBuffer buffer) { this.requestId = buffer.getShort(); buffer.rewind(); header = RequestHeader.parse(buffer); if (header.apiKey() == ApiKeys.API_VERSIONS.id && !Protocol.apiVersionSupported(header.apiKey(), header.apiVersion())) { body = new ApiVersionsRequest(); } else { body = AbstractRequest.getRequest(header.apiKey(), header.apiVersion(), buffer); } this.clientAddress = ((InetSocketAddress) ctx.getChannel().getRemoteAddress()).getAddress(); }