All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redismq.utils.RedisMQDataHelper Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
package com.redismq.utils;

/**
 * @Author: hzh
 * @Date: 2022/11/7 11:03
 * 目前主要是用作mq事务后提交的功能
 */
public class RedisMQDataHelper {
    public static final ThreadLocal SEND_AFTER_COMMIT = new ThreadLocal<>();

    public static void sendAfterCommit(boolean sendAfterCommit) {
        SEND_AFTER_COMMIT.set(sendAfterCommit);
    }

    public static Boolean get() {
        Boolean sendAfterCommit = SEND_AFTER_COMMIT.get();
        SEND_AFTER_COMMIT.remove();
        return sendAfterCommit;
    }

    public static void remove() {
        SEND_AFTER_COMMIT.remove();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy