@Override
    public void shutdownAll() {
        BaseMsgSenderFactory tmpFactory;
        synchronized (singletonRefCounter) {
            if (!initialized.get()
                    || singletonRefCounter.decrementAndGet() > 0) {
                return;
            }
            tmpFactory = baseMsgSenderFactory;
            baseMsgSenderFactory = null;
            initialized.set(false);
        }
        if (tmpFactory != null) {
            tmpFactory.close();
        }
    }
Singleton Message Sender Factory

Used to define the singleton sender factory
inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/MsgSenderSingleFactory.java