You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I plan to use hystrix in a couple of internal libraries we have to provide node level fault isolation (#862). I understand the hierarchy of group-threadpool-command. I wanted to understand the behaviour in case of naming collision.
Ex: I have the following implementation in Library1
class Lib1HystrixCommand extends HystrixCommand <Object1> {
public Lib1HystrixCommand(String host, String port) {
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("HTTP_CALL"))
.andCommandKey(HystrixCommandKey.Factory.asKey(method.getURI().getHost() + "_" + method.getURI().getPort()))
.andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey(method.getURI().getHost())));
}
And this in Library2
class Lib2HystrixCommand extends HystrixCommand <Object2> {
public Lib2HystrixCommand(String host, String port) {
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("HTTP_CALL"))
.andCommandKey(HystrixCommandKey.Factory.asKey(method.getURI().getHost() + "_" + method.getURI().getPort()))
.andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey(method.getURI().getHost())));
}
}
When my service uses these 2 separate libraries to make calls, will they be different groups with separate threadpool or do they get merged because they have the same group/threadpool name.
Thanks,
Rishi.
The text was updated successfully, but these errors were encountered:
@esrishi For a group, the first time a new name is encountered, a HystrixCommandGroupKey object is created. All subsequent references to this name resolve to this object. The same is also true with thread pools and within commands.
From your code example above, you will set up a single group ("HTTP CALL"), with many threadpools (named ). Each threadpool will contain many commands (named <host_port>).
Hi,
I plan to use hystrix in a couple of internal libraries we have to provide node level fault isolation (#862). I understand the hierarchy of group-threadpool-command. I wanted to understand the behaviour in case of naming collision.
Ex: I have the following implementation in Library1
class Lib1HystrixCommand extends HystrixCommand <Object1> {
public Lib1HystrixCommand(String host, String port) {
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("HTTP_CALL"))
.andCommandKey(HystrixCommandKey.Factory.asKey(method.getURI().getHost() + "_" + method.getURI().getPort()))
.andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey(method.getURI().getHost())));
}
And this in Library2
class Lib2HystrixCommand extends HystrixCommand <Object2> {
public Lib2HystrixCommand(String host, String port) {
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("HTTP_CALL"))
.andCommandKey(HystrixCommandKey.Factory.asKey(method.getURI().getHost() + "_" + method.getURI().getPort()))
.andThreadPoolKey(HystrixThreadPoolKey.Factory.asKey(method.getURI().getHost())));
}
}
When my service uses these 2 separate libraries to make calls, will they be different groups with separate threadpool or do they get merged because they have the same group/threadpool name.
Thanks,
Rishi.
The text was updated successfully, but these errors were encountered: