bugfix: fix compatibility issues with 'seata-all-1.4.0'
@@ -36,6 +36,7 @@ import io.seata.core.context.RootContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
@@ -156,11 +157,15 @@ public class SeataHystrixConcurrencyStrategy extends HystrixConcurrencyStrategy
public K call() throws Exception {
try {
RequestContextHolder.setRequestAttributes(requestAttributes);
+ if (!StringUtils.isEmpty(xid)) {
RootContext.bind(xid);
+ }
return actual.call();
}
finally {
+ if (!StringUtils.isEmpty(xid)) {
RootContext.unbind();
+ }
RequestContextHolder.resetRequestAttributes();
}
}
