You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/04/21 16:12:19 UTC
[2/3] camel git commit: CAMEL-9879: Lets use the thread pool from the
group key as default which is what Hystrix suggests.
CAMEL-9879: Lets use the thread pool from the group key as default which is what Hystrix suggests.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/270976c1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/270976c1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/270976c1
Branch: refs/heads/master
Commit: 270976c1e3debbb2dbeccddf609eabe39ffeb89e
Parents: 6f3e8d2
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Apr 21 15:08:00 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Apr 21 16:09:06 2016 +0200
----------------------------------------------------------------------
.../component/hystrix/processor/HystrixProcessorFactory.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/270976c1/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java
index 9dbf970..6f63fa4 100644
--- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java
+++ b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorFactory.java
@@ -76,7 +76,8 @@ public class HystrixProcessorFactory implements ProcessorFactory {
groupKey = HystrixConfigurationDefinition.DEFAULT_GROUP_KEY;
}
if (threadPoolKey == null) {
- threadPoolKey = id + "-threadpool";
+ // by default use the thread pool from the group
+ threadPoolKey = groupKey;
}
// use the node id as the command key
@@ -109,6 +110,7 @@ public class HystrixProcessorFactory implements ProcessorFactory {
HystrixCommand.Setter fallbackSetter = null;
boolean fallbackViaNetwork = cb.getOnFallback() != null && cb.getOnFallback().isFallbackViaNetwork();
if (fallbackViaNetwork) {
+ // use a different thread pool that is for fallback (should never use the same thread pool as the regular command)
HystrixThreadPoolKey tpFallbackKey = HystrixThreadPoolKey.Factory.asKey(threadPoolKey + "-fallback");
fallbackSetter = HystrixCommand.Setter