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
Currently, Hystrix lets you define custom strategies in two ways:
1) with System properties
2) with bootstrapping via HystrixPlugins.getInstance().registerXXX
If neither is specified, the default strategy is used.
This change replaces hardwired System.getProperty calls with lookup
via Archaius. So one can override the plugin strategies used with
any configuration provider Archaius is configured with.
Most importantly, it has the effect of checking any file called
"config.properties" on the classpath as well as using system properties.
This lets you configure plugin strategies without having to write
Java code for it, or having to run the application with additional
system properties.
FixesNetflix#92
* Registry for plugin implementations that allows global override and handles the retrieval of correct implementation based on order of precedence:
34
35
* <ol>
35
36
* <li>plugin registered globally via <code>register</code> methods in this class</li>
36
-
* <li>plugin registered and retrieved using {@link java.lang.System#getProperty(String)} (see get methods for property names)</li>
37
+
* <li>plugin registered and retrieved using Archaius (see get methods for property names)</li>
37
38
* <li>default implementation</li>
38
39
* </ol>
39
40
* See the Hystrix GitHub Wiki for more information: <a href="https://github.com/Netflix/Hystrix/wiki/Plugins">https://github.com/Netflix/Hystrix/wiki/Plugins</a>.
@@ -71,21 +72,21 @@ public static void reset() {
71
72
/**
72
73
* Retrieve instance of {@link HystrixEventNotifier} to use based on order of precedence as defined in {@link HystrixPlugins} class header.
73
74
* <p>
74
-
* Override default by using {@link #registerEventNotifier(HystrixEventNotifier)} or setting property: <code>hystrix.plugin.HystrixEventNotifier.implementation</code> with the full classname to
75
+
* Override default by using {@link #registerEventNotifier(HystrixEventNotifier)} or setting property (via Archaius): <code>hystrix.plugin.HystrixEventNotifier.implementation</code> with the full classname to
75
76
* load.
76
77
*
77
78
* @return {@link HystrixEventNotifier} implementation to use
78
79
*/
79
80
publicHystrixEventNotifiergetEventNotifier() {
80
81
if (notifier.get() == null) {
81
-
// check for an implementation from System.getProperty first
@@ -109,21 +110,21 @@ public void registerEventNotifier(HystrixEventNotifier impl) {
109
110
/**
110
111
* Retrieve instance of {@link HystrixConcurrencyStrategy} to use based on order of precedence as defined in {@link HystrixPlugins} class header.
111
112
* <p>
112
-
* Override default by using {@link #registerConcurrencyStrategy(HystrixConcurrencyStrategy)} or setting property: <code>hystrix.plugin.HystrixConcurrencyStrategy.implementation</code> with the
113
+
* Override default by using {@link #registerConcurrencyStrategy(HystrixConcurrencyStrategy)} or setting property (via Archaius): <code>hystrix.plugin.HystrixConcurrencyStrategy.implementation</code> with the
113
114
* full classname to load.
114
115
*
115
116
* @return {@link HystrixConcurrencyStrategy} implementation to use
@@ -147,21 +148,21 @@ public void registerConcurrencyStrategy(HystrixConcurrencyStrategy impl) {
147
148
/**
148
149
* Retrieve instance of {@link HystrixMetricsPublisher} to use based on order of precedence as defined in {@link HystrixPlugins} class header.
149
150
* <p>
150
-
* Override default by using {@link #registerMetricsPublisher(HystrixMetricsPublisher)} or setting property: <code>hystrix.plugin.HystrixMetricsPublisher.implementation</code> with the full
151
+
* Override default by using {@link #registerMetricsPublisher(HystrixMetricsPublisher)} or setting property (via Archaius): <code>hystrix.plugin.HystrixMetricsPublisher.implementation</code> with the full
151
152
* classname to load.
152
153
*
153
154
* @return {@link HystrixMetricsPublisher} implementation to use
@@ -185,21 +186,21 @@ public void registerMetricsPublisher(HystrixMetricsPublisher impl) {
185
186
/**
186
187
* Retrieve instance of {@link HystrixPropertiesStrategy} to use based on order of precedence as defined in {@link HystrixPlugins} class header.
187
188
* <p>
188
-
* Override default by using {@link #registerPropertiesStrategy(HystrixPropertiesStrategy)} or setting property: <code>hystrix.plugin.HystrixPropertiesStrategy.implementation</code> with the full
189
+
* Override default by using {@link #registerPropertiesStrategy(HystrixPropertiesStrategy)} or setting property (via Archaius): <code>hystrix.plugin.HystrixPropertiesStrategy.implementation</code> with the full
189
190
* classname to load.
190
191
*
191
192
* @return {@link HystrixPropertiesStrategy} implementation to use
@@ -223,7 +224,7 @@ public void registerPropertiesStrategy(HystrixPropertiesStrategy impl) {
223
224
/**
224
225
* Retrieve instance of {@link HystrixCommandExecutionHook} to use based on order of precedence as defined in {@link HystrixPlugins} class header.
225
226
* <p>
226
-
* Override default by using {@link #registerCommandExecutionHook(HystrixCommandExecutionHook)} or setting property: <code>hystrix.plugin.HystrixCommandExecutionHook.implementation</code> with the
227
+
* Override default by using {@link #registerCommandExecutionHook(HystrixCommandExecutionHook)} or setting property (via Archaius): <code>hystrix.plugin.HystrixCommandExecutionHook.implementation</code> with the
227
228
* full classname to
228
229
* load.
229
230
*
@@ -233,14 +234,14 @@ public void registerPropertiesStrategy(HystrixPropertiesStrategy impl) {
0 commit comments