Search in sources :

Example 1 with ClientProperties

use of com.netflix.ribbon.proxy.annotation.ClientProperties in project ribbon by Netflix.

the class ClientPropertiesProcessor method process.

@Override
public void process(String groupName, GroupBuilder groupBuilder, RibbonResourceFactory resourceFactory, Class<?> interfaceClass) {
    ClientProperties properties = interfaceClass.getAnnotation(ClientProperties.class);
    if (properties != null) {
        IClientConfig config = resourceFactory.getClientConfigFactory().newConfig();
        for (Property prop : properties.properties()) {
            String name = prop.name();
            config.set(CommonClientConfigKey.valueOf(name), prop.value());
        }
        ClientOptions options = ClientOptions.from(config);
        groupBuilder.withClientOptions(options);
        if (properties.exportToArchaius()) {
            exportPropertiesToArchaius(groupName, config, interfaceClass.getName());
        }
    }
}
Also used : ClientOptions(com.netflix.ribbon.ClientOptions) ClientProperties(com.netflix.ribbon.proxy.annotation.ClientProperties) IClientConfig(com.netflix.client.config.IClientConfig) Property(com.netflix.ribbon.proxy.annotation.ClientProperties.Property)

Aggregations

IClientConfig (com.netflix.client.config.IClientConfig)1 ClientOptions (com.netflix.ribbon.ClientOptions)1 ClientProperties (com.netflix.ribbon.proxy.annotation.ClientProperties)1 Property (com.netflix.ribbon.proxy.annotation.ClientProperties.Property)1