Override getThreadPool from HystrixConcurrencyStrategy and delegate to

existing strategy if present. Fixes #2035
This commit is contained in:
Piotr Mionskowski
2017-06-14 15:09:05 +02:00
parent aac7799e3e
commit 779b026e6b

View File

@@ -21,6 +21,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.netflix.hystrix.HystrixThreadPoolProperties;
import org.springframework.security.concurrent.DelegatingSecurityContextCallable;
import com.netflix.hystrix.HystrixThreadPoolKey;
@@ -68,6 +69,13 @@ public class SecurityContextConcurrencyStrategy extends HystrixConcurrencyStrate
keepAliveTime, unit, workQueue);
}
@Override
public ThreadPoolExecutor getThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolProperties threadPoolProperties) {
return existingConcurrencyStrategy != null
? existingConcurrencyStrategy.getThreadPool(threadPoolKey, threadPoolProperties)
: super.getThreadPool(threadPoolKey, threadPoolProperties);
}
@Override
public <T> Callable<T> wrapCallable(Callable<T> callable) {
return existingConcurrencyStrategy != null