private void responsePackage(ChannelHandlerContext ctx,
            ProxySdk.ResultCode code,
            ProxySdk.MessagePack packObject) throws Exception {
        ProxySdk.ResponseInfo.Builder builder = ProxySdk.ResponseInfo.newBuilder();
        builder.setResult(code);
        ProxySdk.MessagePackHeader header = packObject.getHeader();
        builder.setPackId(header.getPackId());

        // encode
        byte[] responseBytes = builder.build().toByteArray();
        //
        ByteBuf buffer = Unpooled.wrappedBuffer(responseBytes);
        Channel remoteChannel = ctx.channel();
        if (remoteChannel.isWritable()) {
            remoteChannel.write(buffer);
        } else {
            buffer.release();
            logger.warn("Send buffer2 is not writable, disconnect {}", remoteChannel);
            throw new ChannelUnWritableException("Send buffer2 is not writable, disconnect " + remoteChannel);
        }
    }
responsePackage

@param  ctx
@param  code
@throws Exception
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/source/ServerMessageHandler.java