private Runnable coreThread() {
        return () -> {
            AgentThreadFactory.nameThread(
                    "flushCache-" + profile.getTaskId() + "-" + profile.getInstanceId());
            LOGGER.info("start flush cache {}:{} flush interval {}", inlongGroupId, sourceName, batchFlushInterval);
            running = true;
            while (!shutdown) {
                try {
                    sendMessageFromCache();
                } catch (Throwable e) {
                    LOGGER.error("send message from cache error: ", e);
                }
                AgentUtils.silenceSleepInMs(batchFlushInterval);
            }
            LOGGER.info("stop flush cache {}:{}", inlongGroupId, sourceName);
            running = false;
        };
    }
flush cache by batch

@return thread runner
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sinks/ProxySink.java