@@ -17,6 +17,28 @@ public class HystrixAspect {
1717 private HystrixCommandProperties .Setter commandProperties ;
1818 private HystrixThreadPoolProperties .Setter threadPoolProperties ;
1919
20+ @ Value ("${remoteservice.command.execution.timeout}" )
21+ private int executionTimeout ;
22+
23+ @ Value ("${remoteservice.command.sleepwindow}" )
24+ private int sleepWindow ;
25+
26+ @ Value ("${remoteservice.command.threadpool.maxsize}" )
27+ private int maxThreadCount ;
28+
29+ @ Value ("${remoteservice.command.threadpool.coresize}" )
30+ private int coreThreadCount ;
31+
32+ @ Value ("${remoteservice.command.task.queue.size}" )
33+ private int queueCount ;
34+
35+ @ Value ("${remoteservice.command.group.key}" )
36+ private String groupKey ;
37+
38+ @ Value ("${remoteservice.command.key}" )
39+ private String key ;
40+
41+
2042 @ Around ("@annotation(com.baeldung.hystrix.HystrixCircuitBreaker)" )
2143 public Object circuitBreakerAround (final ProceedingJoinPoint aJoinPoint ) {
2244 return new RemoteServiceCommand (config , aJoinPoint ).execute ();
@@ -31,7 +53,7 @@ private void setup() {
3153 this .commandProperties .withExecutionTimeoutInMilliseconds (executionTimeout );
3254 this .commandProperties .withCircuitBreakerSleepWindowInMilliseconds (sleepWindow );
3355
34- this .threadPoolProperties = HystrixThreadPoolProperties .Setter ();
56+ this .threadPoolProperties = HystrixThreadPoolProperties .Setter ();
3557 this .threadPoolProperties .withMaxQueueSize (maxThreadCount ).withCoreSize (coreThreadCount ).withMaxQueueSize (queueCount );
3658
3759 this .config .andCommandPropertiesDefaults (commandProperties );
@@ -58,24 +80,4 @@ protected String run() throws Exception {
5880 }
5981 }
6082
61- @ Value ("${remoteservice.command.execution.timeout}" )
62- private int executionTimeout ;
63-
64- @ Value ("${remoteservice.command.sleepwindow}" )
65- private int sleepWindow ;
66-
67- @ Value ("${remoteservice.command.threadpool.maxsize}" )
68- private int maxThreadCount ;
69-
70- @ Value ("${remoteservice.command.threadpool.coresize}" )
71- private int coreThreadCount ;
72-
73- @ Value ("${remoteservice.command.task.queue.size}" )
74- private int queueCount ;
75-
76- @ Value ("${remoteservice.command.group.key}" )
77- private String groupKey ;
78-
79- @ Value ("${remoteservice.command.key}" )
80- private String key ;
8183}
0 commit comments