Search in sources :

Example 11 with DynamicIntProperty

use of com.netflix.config.DynamicIntProperty in project incubator-servicecomb-java-chassis by apache.

the class ServiceRegistryConfig method getHeartbeatInterval.

public int getHeartbeatInterval() {
    DynamicIntProperty property = DynamicPropertyFactory.getInstance().getIntProperty("cse.service.registry.instance.healthCheck.interval", DEFAULT_CHECK_INTERVAL_IN_S);
    int interval = property.get();
    return interval < 0 ? DEFAULT_CHECK_INTERVAL_IN_S : interval;
}
Also used : DynamicIntProperty(com.netflix.config.DynamicIntProperty)

Example 12 with DynamicIntProperty

use of com.netflix.config.DynamicIntProperty in project incubator-servicecomb-java-chassis by apache.

the class ServiceRegistryConfig method getIdleConnectionTimeout.

public int getIdleConnectionTimeout() {
    // connection pool idle timeout based on client heart beat interval. Heart beat default value is 30.
    DynamicIntProperty property = DynamicPropertyFactory.getInstance().getIntProperty("cse.service.registry.client.timeout.idle", DEFAULT_TIMEOUT_IN_SECONDS * 2);
    int timeout = property.get();
    return timeout < 1 ? DEFAULT_TIMEOUT_IN_SECONDS * 2 : timeout;
}
Also used : DynamicIntProperty(com.netflix.config.DynamicIntProperty)

Example 13 with DynamicIntProperty

use of com.netflix.config.DynamicIntProperty in project incubator-servicecomb-java-chassis by apache.

the class ServiceRegistryConfig method getResendHeartBeatTimes.

public int getResendHeartBeatTimes() {
    DynamicIntProperty property = DynamicPropertyFactory.getInstance().getIntProperty("cse.service.registry.instance.healthCheck.times", DEFAULT_CHECK_TIMES);
    int times = property.get();
    return times < 0 ? DEFAULT_CHECK_TIMES : times;
}
Also used : DynamicIntProperty(com.netflix.config.DynamicIntProperty)

Example 14 with DynamicIntProperty

use of com.netflix.config.DynamicIntProperty in project incubator-servicecomb-java-chassis by apache.

the class FaultInjectionConfig method getConfigVal.

public static int getConfigVal(String config, int defaultValue) {
    DynamicIntProperty dynamicIntProperty = DynamicPropertyFactory.getInstance().getIntProperty(config, defaultValue);
    cfgCallback.computeIfAbsent(config, key -> {
        dynamicIntProperty.addCallback(() -> {
            int newValue = dynamicIntProperty.get();
            String cfgName = dynamicIntProperty.getName();
            // store the value in config center map and check for next requests.
            FaultInjectionUtil.setConfigCenterValue(cfgName, new AtomicInteger(newValue));
            LOGGER.info("{} changed to {}", cfgName, newValue);
        });
        return config;
    });
    return dynamicIntProperty.get();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DynamicIntProperty(com.netflix.config.DynamicIntProperty)

Example 15 with DynamicIntProperty

use of com.netflix.config.DynamicIntProperty in project java-chassis by ServiceComb.

the class ServiceRegistryConfigBuilder method getInstancePullInterval.

public int getInstancePullInterval() {
    DynamicIntProperty property = DynamicPropertyFactory.getInstance().getIntProperty("servicecomb.service.registry.instance.pull.interval", ServiceRegistryConfig.DEFAULT_CHECK_INTERVAL_IN_S);
    int interval = property.get();
    return interval < 0 ? ServiceRegistryConfig.DEFAULT_CHECK_INTERVAL_IN_S : interval;
}
Also used : DynamicIntProperty(com.netflix.config.DynamicIntProperty)

Aggregations

DynamicIntProperty (com.netflix.config.DynamicIntProperty)34 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 DynamicFloatProperty (com.netflix.config.DynamicFloatProperty)1 HystrixCommandProperties (com.netflix.hystrix.HystrixCommandProperties)1 ChannelConfig (com.netflix.netty.common.channel.config.ChannelConfig)1 ServerSslConfig (com.netflix.netty.common.ssl.ServerSslConfig)1 Http2SslChannelInitializer (com.netflix.zuul.netty.server.http2.Http2SslChannelInitializer)1 BaseSslContextFactory (com.netflix.zuul.netty.ssl.BaseSslContextFactory)1 SampleSSEPushChannelInitializer (com.netflix.zuul.sample.push.SampleSSEPushChannelInitializer)1 SampleWebSocketPushChannelInitializer (com.netflix.zuul.sample.push.SampleWebSocketPushChannelInitializer)1 ChannelInitializer (io.netty.channel.ChannelInitializer)1 InetSocketAddress (java.net.InetSocketAddress)1 SocketAddress (java.net.SocketAddress)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Header (org.apache.http.Header)1 ThreadSafeClientConnManager (org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager)1 BasicHeader (org.apache.http.message.BasicHeader)1 HttpParams (org.apache.http.params.HttpParams)1