set queueSizeRejectionThreshold after creating command group

834 views
Skip to first unread message

eh...@gigya-inc.com

unread,
Sep 4, 2014, 11:58:40 AM9/4/14
to hystr...@googlegroups.com
Hi, 
I can not set queueSizeRejectionThreshold after I created command group.
I thought that the reason for having queueSizeRejectionThreshold is cause the MaxQueuesize can not be changed in runtime wheres the rejection property can.
in addition i can see the following java documentation under HystrixThreadPoolProperties$Setter :
 /**
     * Fluent interface that allows chained setting of properties that can be passed into a {@link HystrixThreadPool} via a {@link HystrixCommand} constructor to inject instance specific property
     * overrides.
     * <p>
     * See {@link HystrixPropertiesStrategy} for more information on order of precedence.
     * <p>
     * Example:
     * <p>
     * <pre> {@code
     * HystrixThreadPoolProperties.Setter()
     *           .setCoreSize(10)
     *           .setQueueSizeRejectionThreshold(10);
     * } </pre>
     */

But there is no setQueueSizeRejectionThreshold and even if I use the Setter api this is not helping me since I get the first value that was initiate to this command group.

In other documentation:

it says :
"Default Property: hystrix.threadpool.default.queueSizeRejectionThreshold
Instance Property: hystrix.threadpool."

I don't  understand how should i use it 

Will appreciate any advice 

BTW I am using hystrix-core-1.3.8

Ben Christensen

unread,
Sep 4, 2014, 1:23:41 PM9/4/14
to hystr...@googlegroups.com, eh...@gigya-inc.com
The javadoc was wrong, it is “ withQueueSizeRejectionThreshold” instead of “setQueueSizeRejectionThreshold"


It can also be set using dynamic properties as per the wiki.

-- 
Ben Christensen - Netflix Edge Engineering
+1.310.782.5511  @benjchristensen
--
You received this message because you are subscribed to the Google Groups "HystrixOSS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hystrixoss+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eh...@gigya-inc.com

unread,
Sep 7, 2014, 5:40:16 AM9/7/14
to hystr...@googlegroups.com, eh...@gigya-inc.com
Hi Ben, 
First thanks for the quick response , 

Second I understand that in order to use the setter I should use withQueueSizeRejectionThreshold.

The problem is that after I already created group of command, the Hystrix thread pool "Remembers" (is uses some kind of static map) the properties and uses the same thread pool,
So even if I create a new command (with the same group name) I get the old properties. 

I can try reference to this static map by having the same package, but that's look like a hack and not like the best practice,

So I will appreciate if you have a piece of code that works for you with the same command group name.

Thanks

Ehud

Ben Christensen

unread,
Sep 8, 2014, 1:57:20 PM9/8/14
to hystr...@googlegroups.com, eh...@gigya-inc.com, eh...@gigya-inc.com
The setting is per ThreadPool, thus the value set in “withQueueSize” can not be different on two commands that use the same thread pool. Whichever is initialized first will win.

To change a setting dynamically you use the Archaius properties system which allows you to dynamically change properties: https://github.com/Netflix/Hystrix/wiki/Configuration

The “with” values are setting property level #3 (there are 4 levels). You can override at runtime by setting level #4 using Archaius.

-- 
Ben Christensen - Netflix Edge Engineering
+1.310.782.5511  @benjchristensen

Reply all
Reply to author
Forward
0 new messages