public class DefaultClientConfigImpl
extends com.netflix.client.config.AbstractDefaultClientConfigImpl
The easiest way to configure client and load balancer is through loading properties into Archaius that conform to the specific format:
<clientName>.<nameSpace>.<propertyName>=<value>
You can define properties in a file on classpath or as system properties. If former, ConfigurationManager.loadPropertiesFromResources() API should be called to load the file.
By default, "ribbon" should be the nameSpace.
If there is no property specified for a named client, com.netflix.client.ClientFactory will still create the client and
load balancer with default values for all necessary properties. The default
values are specified in this class as constants.
If a property is missing the clientName, it is interpreted as a property that applies to all clients. For example
ribbon.ReadTimeout=1000
This will establish the default ReadTimeout property for all clients.
You can also programmatically set properties by constructing instance of DefaultClientConfigImpl. Follow these steps:
getClientConfigWithDefaultValues(String) to load default values,
and any properties that are already defined with Configuration in Archaius
ReloadableClientConfig.setProperty(IClientConfigKey, Object) API.
com.netflix.client.ClientFactory API.
If it is desired to have properties defined in a different name space, for example, "foo"
myclient.foo.ReadTimeout=1000
You should use getClientConfigWithDefaultValues(String, String) - in the first step above.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_PROPERTY_NAME_SPACE |
DEFAULT_BACKOFF_INTERVAL, DEFAULT_CLIENT_CLASSNAME, DEFAULT_CONNECT_TIMEOUT, DEFAULT_CONNECTION_IDLE_TIMERTASK_REPEAT_IN_MSECS, DEFAULT_CONNECTION_MANAGER_TIMEOUT, DEFAULT_CONNECTION_POOL_CLEANER_TASK_ENABLED, DEFAULT_CONNECTIONIDLE_TIME_IN_MSECS, DEFAULT_ENABLE_CONNECTION_POOL, DEFAULT_ENABLE_GZIP_CONTENT_ENCODING_FILTER, DEFAULT_ENABLE_LOADBALANCER, DEFAULT_ENABLE_NIWS_EVENT_LOGGING, DEFAULT_ENABLE_PRIME_CONNECTIONS, DEFAULT_ENABLE_REQUEST_THROTTLING, DEFAULT_ENABLE_ZONE_AFFINITY, DEFAULT_ENABLE_ZONE_EXCLUSIVITY, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_IS_CLIENT_AUTH_REQUIRED, DEFAULT_MAX_AUTO_RETRIES, DEFAULT_MAX_AUTO_RETRIES_NEXT_SERVER, DEFAULT_MAX_CONNECTIONS_PER_HOST, DEFAULT_MAX_HTTP_CONNECTIONS_PER_HOST, DEFAULT_MAX_REQUESTS_ALLOWED_PER_WINDOW, DEFAULT_MAX_RETRIES_PER_SERVER_PRIME_CONNECTION, DEFAULT_MAX_TOTAL_CONNECTIONS, DEFAULT_MAX_TOTAL_HTTP_CONNECTIONS, DEFAULT_MAX_TOTAL_TIME_TO_PRIME_CONNECTIONS, DEFAULT_MIN_PRIME_CONNECTIONS_RATIO, DEFAULT_NFLOADBALANCER_CLASSNAME, DEFAULT_NFLOADBALANCER_PING_CLASSNAME, DEFAULT_NFLOADBALANCER_RULE_CLASSNAME, DEFAULT_OK_TO_RETRY_ON_ALL_OPERATIONS, DEFAULT_PERCENTAGE_NIWS_EVENT_LOGGED, DEFAULT_POOL_KEEP_ALIVE_TIME, DEFAULT_POOL_KEEP_ALIVE_TIME_UNITS, DEFAULT_POOL_MAX_THREADS, DEFAULT_POOL_MIN_THREADS, DEFAULT_PORT, DEFAULT_PRIME_CONNECTIONS_CLASS, DEFAULT_PRIME_CONNECTIONS_URI, DEFAULT_PRIORITIZE_VIP_ADDRESS_BASED_SERVERS, DEFAULT_READ_TIMEOUT, DEFAULT_REQUEST_THROTTLING_WINDOW_IN_MILLIS, DEFAULT_SERVER_LIST_UPDATER_CLASS, DEFAULT_SEVER_LIST_CLASS, DEFAULT_USEIPADDRESS_FOR_SERVER, DEFAULT_VIPADDRESS_RESOLVER_CLASSNAME| Constructor and Description |
|---|
DefaultClientConfigImpl()
Create instance with no properties in default name space
DEFAULT_PROPERTY_NAME_SPACE |
DefaultClientConfigImpl(java.lang.String nameSpace)
Create instance with no properties in the specified name space
|
| Modifier and Type | Method and Description |
|---|---|
static DefaultClientConfigImpl |
getClientConfigWithDefaultValues() |
static DefaultClientConfigImpl |
getClientConfigWithDefaultValues(java.lang.String clientName) |
static DefaultClientConfigImpl |
getClientConfigWithDefaultValues(java.lang.String clientName,
java.lang.String nameSpace) |
java.lang.String |
getDefaultClientClassname()
Deprecated.
|
int |
getDefaultConnectionidleTimeInMsecs()
Deprecated.
|
int |
getDefaultConnectionIdleTimertaskRepeatInMsecs()
Deprecated.
|
int |
getDefaultConnectionManagerTimeout()
Deprecated.
|
java.lang.Boolean |
getDefaultConnectionPoolCleanerTaskEnabled()
Deprecated.
|
int |
getDefaultConnectTimeout()
Deprecated.
|
java.lang.Boolean |
getDefaultEnableConnectionPool()
Deprecated.
|
java.lang.Boolean |
getDefaultEnableGzipContentEncodingFilter()
Deprecated.
|
java.lang.Boolean |
getDefaultEnableLoadbalancer()
Deprecated.
|
java.lang.Boolean |
getDefaultEnablePrimeConnections()
Deprecated.
|
java.lang.Boolean |
getDefaultEnableRequestThrottling()
Deprecated.
|
java.lang.Boolean |
getDefaultEnableZoneAffinity()
Deprecated.
|
java.lang.Boolean |
getDefaultEnableZoneExclusivity()
Deprecated.
|
java.lang.Boolean |
getDefaultFollowRedirects()
Deprecated.
|
java.lang.Boolean |
getDefaultIsClientAuthRequired()
Deprecated.
|
int |
getDefaultMaxAutoRetries()
Deprecated.
|
int |
getDefaultMaxAutoRetriesNextServer()
Deprecated.
|
int |
getDefaultMaxConnectionsPerHost()
Deprecated.
|
int |
getDefaultMaxHttpConnectionsPerHost()
Deprecated.
|
int |
getDefaultMaxRequestsAllowedPerWindow()
Deprecated.
|
int |
getDefaultMaxRetriesPerServerPrimeConnection()
Deprecated.
|
int |
getDefaultMaxTotalConnections()
Deprecated.
|
int |
getDefaultMaxTotalHttpConnections()
Deprecated.
|
int |
getDefaultMaxTotalTimeToPrimeConnections()
Deprecated.
|
float |
getDefaultMinPrimeConnectionsRatio()
Deprecated.
|
java.lang.String |
getDefaultNfloadbalancerClassname()
Deprecated.
|
java.lang.String |
getDefaultNfloadbalancerPingClassname()
Deprecated.
|
java.lang.String |
getDefaultNfloadbalancerRuleClassname()
Deprecated.
|
java.lang.Boolean |
getDefaultOkToRetryOnAllOperations()
Deprecated.
|
float |
getDefaultPercentageNiwsEventLogged()
Deprecated.
|
long |
getDefaultPoolKeepAliveTime()
Deprecated.
|
java.util.concurrent.TimeUnit |
getDefaultPoolKeepAliveTimeUnits()
Deprecated.
|
int |
getDefaultPoolMaxThreads()
Deprecated.
|
int |
getDefaultPoolMinThreads()
Deprecated.
|
int |
getDefaultPort()
Deprecated.
|
java.lang.String |
getDefaultPrimeConnectionsClass()
Deprecated.
|
java.lang.String |
getDefaultPrimeConnectionsUri()
Deprecated.
|
java.lang.Boolean |
getDefaultPrioritizeVipAddressBasedServers()
Deprecated.
|
java.lang.String |
getDefaultPropName(com.netflix.client.config.IClientConfigKey propName) |
int |
getDefaultReadTimeout()
Deprecated.
|
int |
getDefaultRequestThrottlingWindowInMillis()
Deprecated.
|
java.lang.String |
getDefaultSeverListClass()
Deprecated.
|
boolean |
getDefaultUseIpAddressForServer()
Deprecated.
|
java.lang.String |
getDefaultVipaddressResolverClassname()
Deprecated.
|
static DefaultClientConfigImpl |
getEmptyConfig() |
void |
loadDefaultValues() |
protected void |
putDefaultBooleanProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Boolean defaultValue)
Deprecated.
|
protected void |
putDefaultFloatProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Float defaultValue)
Deprecated.
|
protected void |
putDefaultIntegerProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Integer defaultValue)
Deprecated.
|
protected void |
putDefaultLongProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Long defaultValue)
Deprecated.
|
protected void |
putDefaultStringProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.String defaultValue)
Deprecated.
|
protected void |
putDefaultTimeUnitProperty(com.netflix.client.config.IClientConfigKey propName,
java.util.concurrent.TimeUnit defaultValue)
Deprecated.
|
protected void |
setPropertyInternal(com.netflix.client.config.IClientConfigKey propName,
java.lang.Object value)
Deprecated.
|
DefaultClientConfigImpl |
withProperty(com.netflix.client.config.IClientConfigKey key,
java.lang.Object value) |
getAppName, getResolver, getVersion, resolveDeploymentContextbasedVipAddresses, setVipAddressResolverapplyOverride, containsProperty, forEach, get, get, getClientName, getDynamicProperty, getGlobalProperty, getIfSet, getNameSpace, getPrefixMappedProperty, getProperties, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsInteger, getPropertyAsString, getPropertyResolver, getRefreshCount, getScopedProperty, loadProperties, reload, set, setClientName, setNameSpace, setProperty, toStringpublic static final java.lang.String DEFAULT_PROPERTY_NAME_SPACE
public DefaultClientConfigImpl()
DEFAULT_PROPERTY_NAME_SPACEpublic DefaultClientConfigImpl(java.lang.String nameSpace)
@Deprecated public java.lang.Boolean getDefaultPrioritizeVipAddressBasedServers()
@Deprecated public java.lang.String getDefaultNfloadbalancerPingClassname()
@Deprecated public java.lang.String getDefaultNfloadbalancerRuleClassname()
@Deprecated public java.lang.String getDefaultNfloadbalancerClassname()
@Deprecated public boolean getDefaultUseIpAddressForServer()
@Deprecated public java.lang.String getDefaultClientClassname()
@Deprecated public java.lang.String getDefaultVipaddressResolverClassname()
@Deprecated public java.lang.String getDefaultPrimeConnectionsUri()
@Deprecated public int getDefaultMaxTotalTimeToPrimeConnections()
@Deprecated public int getDefaultMaxRetriesPerServerPrimeConnection()
@Deprecated public java.lang.Boolean getDefaultEnablePrimeConnections()
@Deprecated public int getDefaultMaxRequestsAllowedPerWindow()
@Deprecated public int getDefaultRequestThrottlingWindowInMillis()
@Deprecated public java.lang.Boolean getDefaultEnableRequestThrottling()
@Deprecated public java.lang.Boolean getDefaultEnableGzipContentEncodingFilter()
@Deprecated public java.lang.Boolean getDefaultConnectionPoolCleanerTaskEnabled()
@Deprecated public java.lang.Boolean getDefaultFollowRedirects()
@Deprecated public float getDefaultPercentageNiwsEventLogged()
@Deprecated public int getDefaultMaxAutoRetriesNextServer()
@Deprecated public int getDefaultMaxAutoRetries()
@Deprecated public int getDefaultReadTimeout()
@Deprecated public int getDefaultConnectionManagerTimeout()
@Deprecated public int getDefaultConnectTimeout()
@Deprecated public int getDefaultMaxHttpConnectionsPerHost()
@Deprecated public int getDefaultMaxTotalHttpConnections()
@Deprecated public int getDefaultMaxConnectionsPerHost()
@Deprecated public int getDefaultMaxTotalConnections()
@Deprecated public float getDefaultMinPrimeConnectionsRatio()
@Deprecated public java.lang.String getDefaultPrimeConnectionsClass()
@Deprecated public java.lang.String getDefaultSeverListClass()
@Deprecated public int getDefaultConnectionIdleTimertaskRepeatInMsecs()
@Deprecated public int getDefaultConnectionidleTimeInMsecs()
@Deprecated public int getDefaultPoolMaxThreads()
@Deprecated public int getDefaultPoolMinThreads()
@Deprecated public long getDefaultPoolKeepAliveTime()
@Deprecated public java.util.concurrent.TimeUnit getDefaultPoolKeepAliveTimeUnits()
@Deprecated public java.lang.Boolean getDefaultEnableZoneAffinity()
@Deprecated public java.lang.Boolean getDefaultEnableZoneExclusivity()
@Deprecated public int getDefaultPort()
@Deprecated public java.lang.Boolean getDefaultEnableLoadbalancer()
@Deprecated public java.lang.Boolean getDefaultOkToRetryOnAllOperations()
@Deprecated public java.lang.Boolean getDefaultIsClientAuthRequired()
@Deprecated public java.lang.Boolean getDefaultEnableConnectionPool()
public void loadDefaultValues()
@Deprecated
protected void setPropertyInternal(com.netflix.client.config.IClientConfigKey propName,
java.lang.Object value)
@Deprecated
protected void putDefaultIntegerProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Integer defaultValue)
@Deprecated
protected void putDefaultLongProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Long defaultValue)
@Deprecated
protected void putDefaultFloatProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Float defaultValue)
@Deprecated
protected void putDefaultTimeUnitProperty(com.netflix.client.config.IClientConfigKey propName,
java.util.concurrent.TimeUnit defaultValue)
@Deprecated
protected void putDefaultStringProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.String defaultValue)
@Deprecated
protected void putDefaultBooleanProperty(com.netflix.client.config.IClientConfigKey propName,
java.lang.Boolean defaultValue)
public java.lang.String getDefaultPropName(com.netflix.client.config.IClientConfigKey propName)
public DefaultClientConfigImpl withProperty(com.netflix.client.config.IClientConfigKey key, java.lang.Object value)
public static DefaultClientConfigImpl getEmptyConfig()
public static DefaultClientConfigImpl getClientConfigWithDefaultValues(java.lang.String clientName)
public static DefaultClientConfigImpl getClientConfigWithDefaultValues()
public static DefaultClientConfigImpl getClientConfigWithDefaultValues(java.lang.String clientName, java.lang.String nameSpace)