private void sendBatchWithRetryCount(SenderMessage message, int retry) {
        boolean suc = false;
        while (!suc && !shutdown) {
            try {
                AgentSenderCallback cb = new AgentSenderCallback(message, retry);
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TRY_SEND, message.getGroupId(),
                        message.getStreamId(), message.getDataTime(), message.getMsgCnt(),
                        message.getTotalSize(), auditVersion);
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_TRY_SEND_REAL_TIME, message.getGroupId(),
                        message.getStreamId(), AgentUtils.getCurrentTime(), message.getMsgCnt(),
                        message.getTotalSize(), auditVersion);
                asyncSendByMessageSender(cb, message.getDataList(), message.getGroupId(),
                        message.getStreamId(), message.getDataTime(), SEQUENTIAL_ID.getNextUuid(),
                        message.getExtraMap(), proxySend);
                getMetricItem(message.getGroupId(), message.getStreamId()).pluginSendCount.addAndGet(
                        message.getMsgCnt());
                suc = true;
            } catch (Exception exception) {
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_SEND_EXCEPTION, message.getGroupId(),
                        message.getStreamId(), message.getDataTime(), message.getMsgCnt(),
                        message.getTotalSize(), auditVersion);
                AuditUtils.add(AuditUtils.AUDIT_ID_AGENT_SEND_EXCEPTION_REAL_TIME, message.getGroupId(),
                        message.getStreamId(), AgentUtils.getCurrentTime(), message.getMsgCnt(),
                        message.getTotalSize(), auditVersion);
                suc = false;
                if (retry > maxSenderRetry) {
                    if (retry % 10 == 0) {
                        LOGGER.error("max retry reached, sample log Exception caught", exception);
                    }
                } else {
                    LOGGER.error("Exception caught", exception);
                }
                retry++;
                AgentUtils.silenceSleepInMs(retrySleepTime);
                ThreadUtils.threadThrowableHandler(Thread.currentThread(), exception);
            }
        }
    }
Send message to proxy by batch, use message cache.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/dataproxy/Sender.java