Skip to content

Commit

Permalink
Merge pull request spring-cloud#2044 from bright/override_all_hystrix…
Browse files Browse the repository at this point in the history
…_concurrency_strategy_methods

Override getThreadPool from HystrixConcurrencyStrategy and delegate to
  • Loading branch information
ryanjbaxter committed Jun 16, 2017
2 parents aac7799 + 779b026 commit 9a878b0
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -21,6 +21,7 @@
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;
Expand Down Expand Up @@ -68,6 +69,13 @@ public ThreadPoolExecutor getThreadPool(HystrixThreadPoolKey threadPoolKey,
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
Expand Down

0 comments on commit 9a878b0

Please sign in to comment.