Open dstengle opened 9 years ago
You can do that with @ClientProperties
. See
The properties defined with such annotations will be exported to Archaius configuration manager.
I want the properties to be read from archaius, not written to. I want an IClientConfig to be built from properties, not the other way around. Like the older code:
RestClient client = (RestClient) ClientFactory.getNamedClient("sample-client")
With @ClientProperties it's back to hard-coding things.
What about a @NamedClient / @NamedClientProperties annotation or something similar? It seems like the same config code is used underneath and ultimately it all comes back to an IClientConfig.
There is no explicit API to create named client using annotations. However, you can still have all configurations in Archaius and have the client created using Archaius properties. Here is an example:
This is perfect! I see the implementation in the ResourceGroup.java and how it is derived from the class' simple name in ProxyHttpResourceGroupFactory.java
I was getting geared up to try and do a patch for an annotation, but it looks like it isn't necessary.
Is there any way to contribute to documentation?
It appears that using Ribbon.from and a proxied interface doesn't allow you to configure through archaius properties (although you can write properties, which I don't quite understand the utility of).
It looks like you can do a builder that pulls from the configs the same as you would get a named restclient. Being able to do this with a proxied interface would be great.