-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Archaius for Hystrix plugin setup #711
Use Archaius for Hystrix plugin setup #711
Conversation
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. Fixes Netflix#92
NetflixOSS » Hystrix » Hystrix-pull-requests #60 SUCCESS |
Ideally, it would also check for "hystrix.properties", and use that if found on the classpath? |
If the file hystrix-plugins.properties exists on the class path, its configuration will be used to setup HystrixPlugins. This makes it possible to bundle bootstrap configuration for Hystrix in higher-level libraries without polluting the global namespace with a 'config.properties' file; that name should better be reserved for top-level applications only.
NetflixOSS » Hystrix » Hystrix-pull-requests #61 SUCCESS |
@michaelsembwever @chriswk @hennings would this help us integrate Zipkin and Hystrix without boilerplate in the userland code? |
Thanks for the contribution, @eirslett . This looks like a good change, but I need to play around with it and understand how I would use it before I merge. Along those lines, if you could include some sample setup on how you intend to use it, that would probably be helpful (for me and for the docs) |
Here's a simple demo library, https://github.com/eirslett/pull-request-illustration The idea is that you would put this library in your classpath, and it would bootstrap everything for you. |
This looks like a great change. Thanks for the patience, @eirslett . I'll add some documentation around this to the Wiki shortly. |
…-lookup Use Archaius for Hystrix plugin setup
@eirslett I just added some documentation around this change, as I'm about to release it in 1.4.3. For now, I've got a pointer to your illustrative repo - thanks very much for that! At some point, I will add some examples of this to the Hystrix repo. Can you take a look and see if it makes sense to you? : https://github.com/Netflix/Hystrix/wiki/Plugins#how-to-use /cc @DavidMGross |
Sure, looks good to me! |
According to #92 (comment), Hystrix is supposed to load its configuration from Archaius, but apparently that is not the case with HystrixPlugins. This PR fixes that.