package com.kidgrow.common.context;
|
|
import com.alibaba.ttl.TransmittableThreadLocal;
|
|
/**
|
* 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br>
|
*
|
* @Description: 负载均衡策略Holder<br>
|
* @Project: <br>
|
* @CreateDate: Created in 2020/2/27 19:59 <br>
|
* @Author: <a href="4345453@kidgrow.com">liuke</a>
|
*/
|
public class LbIsolationContextHolder {
|
private static final ThreadLocal<String> VERSION_CONTEXT = new TransmittableThreadLocal<>();
|
|
public static void setVersion(String version) {
|
VERSION_CONTEXT.set(version);
|
}
|
|
public static String getVersion() {
|
return VERSION_CONTEXT.get();
|
}
|
|
public static void clear() {
|
VERSION_CONTEXT.remove();
|
}
|
}
|