@Override
    public void callback(ResultCode resultCode) {
        // If DataProxy have sent timeout response to SDK, DataProxy do not send success response to SDK again when
        // event is success to save.
        if (this.hasResponsed.getAndSet(true)) {
            return;
        }
        // response
        try {
            ResponseInfo.Builder builder = ResponseInfo.newBuilder();
            builder.setResult(resultCode);
            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 {
                if (logCounter.shouldPrint()) {
                    logger.warn("the send buffer2 is full, so disconnect it!"
                            + " please check remote client; Connection info:{}",
                            remoteChannel);
                }
                buffer.release();
            }
        } catch (Throwable e) {
            if (logCounter.shouldPrint()) {
                logger.error("Send response failure", e);
            }
        } finally {
            // notice TCP session
            this.latch.countDown();
        }
    }
callback

@param resultCode the result code
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/source/v1msg/InlongTcpSourceCallback.java