public void close() {
        int currentStatus = senderStatus.get();
        if (currentStatus == SENDER_STATUS_CLOSED) {
            return;
        }
        if (!senderStatus.compareAndSet(currentStatus, SENDER_STATUS_CLOSED)) {
            return;
        }
        long startTime = System.currentTimeMillis();
        logger.info("Sender({}) instance is stopping...", senderId);
        configManager.shutDown();
        clientMgr.stop();
        metricHolder.close();
        if (this.senderFactory != null) {
            this.senderFactory.removeClient(this);
        }
        logger.info("Sender({}) instance stopped, cost {} ms!",
                senderId, System.currentTimeMillis() - startTime);
    }
Base Sender class:

Used to manage Sender metadata information, including Sender ID,
 status, network interaction, metadata query object, and
 Proxy node metadata information obtained from Manager, etc.
inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/sender/BaseSender.java