Class DefaultEurekaServerConfig
- java.lang.Object
-
- com.netflix.eureka.DefaultEurekaServerConfig
-
- All Implemented Interfaces:
EurekaServerConfig
@Singleton public class DefaultEurekaServerConfig extends java.lang.Object implements EurekaServerConfig
A default implementation of eureka server configuration as required byEurekaServerConfig.The information required for configuring eureka server is provided in a configuration file.The configuration file is searched for in the classpath with the name specified by the property eureka.server.props and with the suffix .properties. If the property is not specified, eureka-server.properties is assumed as the default.The properties that are looked up uses the namespace passed on to this class.
If the eureka.environment property is specified, additionally eureka-server-
.properties is loaded in addition to eureka-server.properties.
-
-
Constructor Summary
Constructors Constructor Description DefaultEurekaServerConfig()DefaultEurekaServerConfig(java.lang.String namespace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandisableTransparentFallbackToOtherRegion()Old behavior of fallback to applications in the remote region (if configured) if there are no instances of that application in the local region, will be disabled.longgetASGCacheExpiryTimeoutMs()Get the expiration value for the cached ASG informationintgetASGQueryTimeoutMs()Get the timeout value for querying the AWS for ASG information.longgetASGUpdateIntervalMs()Get the time interval with which the ASG information must be queried from AWS.java.lang.StringgetAWSAccessId()Gets the AWS Access Id.java.lang.StringgetAWSSecretKey()Gets the AWS Secret Key.AwsBindingStrategygetBindingStrategy()Get the configured binding strategy EIP or Route53.longgetDeltaRetentionTimerIntervalInMs()Get the time interval with which the clean up task should wake up and check for expired delta information.intgetEIPBindingRetryIntervalMs()Gets the interval with which the server should check if the EIP is bound and should try to bind in the case if it is already not bound, iff the EIP is already bound.intgetEIPBindingRetryIntervalMsWhenUnbound()Get the interval with which the server should check if the EIP is bound and should try to bind in the case if it is already not bound, iff the EIP is not currently bound.intgetEIPBindRebindRetries()Gets the number of times the server should try to bind to the candidate EIP.longgetEvictionIntervalTimerInMs()Get the time interval with which the task that expires instances should wake up and run.intgetExpectedClientRenewalIntervalSeconds()The interval with which clients are expected to send their heartbeats.java.lang.StringgetExperimental(java.lang.String name)To avoid configuration API pollution when trying new/experimental or features or for the migration process, the corresponding configuration can be put into experimental configuration section.intgetHealthStatusMinNumberOfAvailablePeers()Get the minimum number of available peer replication instances for this instance to be considered healthy.intgetInitialCapacityOfResponseCache()Get the capacity of responseCache, default value is 1000.java.lang.StringgetJsonCodecName()java.lang.StringgetListAutoScalingGroupsRoleName()Name of the Role used to describe auto scaling groups from third AWS accounts.intgetMaxElementsInPeerReplicationPool()Get the maximum number of replication events that can be allowed to back up in the replication pool.intgetMaxElementsInStatusReplicationPool()Get the maximum number of replication events that can be allowed to back up in the status replication pool.longgetMaxIdleThreadAgeInMinutesForPeerReplication()Get the idle time for which the replication threads can stay alive.longgetMaxIdleThreadInMinutesAgeForStatusReplication()Get the idle time for which the status replication threads can stay alive.intgetMaxThreadsForPeerReplication()Get the maximum number of threads to be used for replication.intgetMaxThreadsForStatusReplication()Get the maximum number of threads to be used for status replication.intgetMaxTimeForReplication()Get the time in milliseconds to try to replicate before dropping replication events.intgetMinThreadsForPeerReplication()Get the minimum number of threads to be used for replication.intgetMinThreadsForStatusReplication()Get the minimum number of threads to be used for status replication.java.lang.StringgetMyUrl()Allows to configure URL which Eureka should treat as its own during replication.intgetNumberOfReplicationRetries()Get the number of times the replication events should be retried with peers.intgetPeerEurekaNodesUpdateIntervalMs()The interval with which the information about the changes in peer eureka nodes is updated.intgetPeerEurekaStatusRefreshTimeIntervalMs()Gets the interval with which the status information about peer nodes is updated.intgetPeerNodeConnectionIdleTimeoutSeconds()Gets the idle time after which the HTTP connection should be cleaned up.intgetPeerNodeConnectTimeoutMs()Gets the timeout value for connecting to peer eureka nodes for replication.intgetPeerNodeReadTimeoutMs()Gets the timeout value for reading information from peer eureka nodes for replication.intgetPeerNodeTotalConnections()Gets the total number of HTTP connections allowed to peer eureka nodes for replication.intgetPeerNodeTotalConnectionsPerHost()Gets the total number of HTTP connections allowed to a particular peer eureka node for replication.intgetRateLimiterBurstSize()Rate limiter, token bucket algorithm property.intgetRateLimiterFullFetchAverageRate()Rate limiter, token bucket algorithm property.java.util.Set<java.lang.String>getRateLimiterPrivilegedClients()A list of certified clients.intgetRateLimiterRegistryFetchAverageRate()Rate limiter, token bucket algorithm property.intgetRegistrySyncRetries()Get the number of times that a eureka node would try to get the registry information from the peers during startup.longgetRegistrySyncRetryWaitMs()Get the wait/sleep time between each retry sync attempts, if the prev retry failed and there are more retries to attempt.java.util.Set<java.lang.String>getRemoteRegionAppWhitelist(java.lang.String regionName)Returns a list of applications that must be retrieved from the passed remote region.intgetRemoteRegionConnectionIdleTimeoutSeconds()Gets the idle time after which the HTTP connection should be cleaned up for remote regions.intgetRemoteRegionConnectTimeoutMs()Gets the timeout value for connecting to peer eureka nodes for remote regions.intgetRemoteRegionFetchThreadPoolSize()Size of a thread pool used to execute remote region registry fetch requests.intgetRemoteRegionReadTimeoutMs()Gets the timeout value for reading information from peer eureka nodes for remote regions.intgetRemoteRegionRegistryFetchInterval()Get the time interval for which the registry information need to be fetched from the remote region.intgetRemoteRegionTotalConnections()Gets the total number of HTTP connections allowed to peer eureka nodes for remote regions.intgetRemoteRegionTotalConnectionsPerHost()Gets the total number of HTTP connections allowed to a particular peer eureka node for remote regions.java.lang.StringgetRemoteRegionTrustStore()Gets the fully qualified trust store file that will be used for remote region registry fetches.java.lang.StringgetRemoteRegionTrustStorePassword()Get the remote region trust store's password.java.lang.String[]getRemoteRegionUrls()Get the list of remote region urls.java.util.Map<java.lang.String,java.lang.String>getRemoteRegionUrlsWithName()Expects a property with name: [eureka-namespace].remoteRegionUrlsWithName and a value being a comma separated list of region name & remote url pairs, separated with a ";".doublegetRenewalPercentThreshold()The minimum percentage of renewals that is expected from the clients in the period specified byEurekaServerConfig.getRenewalThresholdUpdateIntervalMs().intgetRenewalThresholdUpdateIntervalMs()The interval with which the threshold as specified inEurekaServerConfig.getRenewalPercentThreshold()needs to be updated.longgetResponseCacheAutoExpirationInSeconds()Gets the time for which the registry payload should be kept in the cache if it is not invalidated by change events.longgetResponseCacheUpdateIntervalMs()Gets the time interval with which the payload cache of the client should be updated.longgetRetentionTimeInMSInDeltaQueue()Get the time for which the delta information should be cached for the clients to retrieve the value without missing it.intgetRoute53BindingRetryIntervalMs()Gets the interval with which the server should check if the Route53 domain is bound and should try to bind in the case if it is already not bound.intgetRoute53BindRebindRetries()Gets the number of times the server should try to bind to the candidate Route53 domain.longgetRoute53DomainTTL()intgetWaitTimeInMsWhenSyncEmpty()Gets the time to wait when the eureka server starts up unable to get instances from peer nodes.java.lang.StringgetXmlCodecName()booleanisRateLimiterEnabled()Indicates whether the rate limiter should be enabled or disabled.booleanisRateLimiterThrottleStandardClients()Indicate if rate limit standard clients.booleanshouldBatchReplication()Indicates whether the replication between cluster nodes should be batched for network efficiency.booleanshouldDisableDelta()Checks to see if the delta information can be served to client or not.booleanshouldDisableDeltaForRemoteRegions()Checks to see if the delta information can be served to client or not for remote regions.booleanshouldEnableReplicatedRequestCompression()If set to true, the replicated data send in the request will be always compressed.booleanshouldEnableSelfPreservation()Checks to see if the eureka server is enabled for self preservation.booleanshouldGZipContentFromRemoteRegion()Indicates whether the content fetched from eureka server has to be compressed for remote regions whenever it is supported by the server.booleanshouldLogIdentityHeaders()Indicates whether the eureka server should log/metric clientAuthHeadersbooleanshouldPrimeAwsReplicaConnections()Checks whether the connections to replicas should be primed.booleanshouldSyncWhenTimestampDiffers()Checks whether to synchronize instances when timestamp differs.booleanshouldUseAwsAsgApi()Whether to use AWS API to query ASG statuses.booleanshouldUseReadOnlyResponseCache()TheResponseCachecurrently uses a two level caching strategy to responses.
-
-
-
Method Detail
-
getAWSAccessId
public java.lang.String getAWSAccessId()
Description copied from interface:EurekaServerConfigGets the AWS Access Id. This is primarily used for Elastic IP Biding. The access id should be provided with appropriate AWS permissions to bind the EIP.- Specified by:
getAWSAccessIdin interfaceEurekaServerConfig- Returns:
-
getAWSSecretKey
public java.lang.String getAWSSecretKey()
Description copied from interface:EurekaServerConfigGets the AWS Secret Key. This is primarily used for Elastic IP Biding. The access id should be provided with appropriate AWS permissions to bind the EIP.- Specified by:
getAWSSecretKeyin interfaceEurekaServerConfig- Returns:
-
getEIPBindRebindRetries
public int getEIPBindRebindRetries()
Description copied from interface:EurekaServerConfigGets the number of times the server should try to bind to the candidate EIP.The changes are effective at runtime.
- Specified by:
getEIPBindRebindRetriesin interfaceEurekaServerConfig- Returns:
- the number of times the server should try to bind to the candidate EIP.
-
getEIPBindingRetryIntervalMsWhenUnbound
public int getEIPBindingRetryIntervalMsWhenUnbound()
Description copied from interface:EurekaServerConfigGet the interval with which the server should check if the EIP is bound and should try to bind in the case if it is already not bound, iff the EIP is not currently bound.The changes are effective at runtime.
- Specified by:
getEIPBindingRetryIntervalMsWhenUnboundin interfaceEurekaServerConfig- Returns:
- the time in milliseconds.
-
getEIPBindingRetryIntervalMs
public int getEIPBindingRetryIntervalMs()
Description copied from interface:EurekaServerConfigGets the interval with which the server should check if the EIP is bound and should try to bind in the case if it is already not bound, iff the EIP is already bound. (so this refresh is just for steady state checks)The changes are effective at runtime.
- Specified by:
getEIPBindingRetryIntervalMsin interfaceEurekaServerConfig- Returns:
- the time in milliseconds.
-
shouldEnableSelfPreservation
public boolean shouldEnableSelfPreservation()
Description copied from interface:EurekaServerConfigChecks to see if the eureka server is enabled for self preservation.When enabled, the server keeps track of the number of renewals it should receive from the server. Any time, the number of renewals drops below the threshold percentage as defined by
EurekaServerConfig.getRenewalPercentThreshold(), the server turns off expirations to avert danger.This will help the server in maintaining the registry information in case of network problems between client and the server.The changes are effective at runtime.
- Specified by:
shouldEnableSelfPreservationin interfaceEurekaServerConfig- Returns:
- true to enable self preservation, false otherwise.
-
getPeerEurekaNodesUpdateIntervalMs
public int getPeerEurekaNodesUpdateIntervalMs()
Description copied from interface:EurekaServerConfigThe interval with which the information about the changes in peer eureka nodes is updated. The user can use the DNS mechanism or dynamic configuration provided by Archaius to change the information dynamically.The changes are effective at runtime.
- Specified by:
getPeerEurekaNodesUpdateIntervalMsin interfaceEurekaServerConfig- Returns:
- timer in milliseconds indicating the interval.
-
getRenewalThresholdUpdateIntervalMs
public int getRenewalThresholdUpdateIntervalMs()
Description copied from interface:EurekaServerConfigThe interval with which the threshold as specified inEurekaServerConfig.getRenewalPercentThreshold()needs to be updated.- Specified by:
getRenewalThresholdUpdateIntervalMsin interfaceEurekaServerConfig- Returns:
- time in milliseconds indicating the interval.
-
getExpectedClientRenewalIntervalSeconds
public int getExpectedClientRenewalIntervalSeconds()
Description copied from interface:EurekaServerConfigThe interval with which clients are expected to send their heartbeats. Defaults to 30 seconds. If clients send heartbeats with different frequency, say, every 15 seconds, then this parameter should be tuned accordingly, otherwise, self-preservation won't work as expected.- Specified by:
getExpectedClientRenewalIntervalSecondsin interfaceEurekaServerConfig- Returns:
- time in seconds indicating the expected interval
-
getRenewalPercentThreshold
public double getRenewalPercentThreshold()
Description copied from interface:EurekaServerConfigThe minimum percentage of renewals that is expected from the clients in the period specified byEurekaServerConfig.getRenewalThresholdUpdateIntervalMs(). If the renewals drop below the threshold, the expirations are disabled if theEurekaServerConfig.shouldEnableSelfPreservation()is enabled.The changes are effective at runtime.
- Specified by:
getRenewalPercentThresholdin interfaceEurekaServerConfig- Returns:
- value between 0 and 1 indicating the percentage. For example,
85%will be specified as0.85.
-
shouldEnableReplicatedRequestCompression
public boolean shouldEnableReplicatedRequestCompression()
Description copied from interface:EurekaServerConfigIf set to true, the replicated data send in the request will be always compressed. This does not define response path, which is driven by "Accept-Encoding" header.- Specified by:
shouldEnableReplicatedRequestCompressionin interfaceEurekaServerConfig
-
getNumberOfReplicationRetries
public int getNumberOfReplicationRetries()
Description copied from interface:EurekaServerConfigGet the number of times the replication events should be retried with peers.The changes are effective at runtime.
- Specified by:
getNumberOfReplicationRetriesin interfaceEurekaServerConfig- Returns:
- the number of retries.
-
getPeerEurekaStatusRefreshTimeIntervalMs
public int getPeerEurekaStatusRefreshTimeIntervalMs()
Description copied from interface:EurekaServerConfigGets the interval with which the status information about peer nodes is updated.The changes are effective at runtime.
- Specified by:
getPeerEurekaStatusRefreshTimeIntervalMsin interfaceEurekaServerConfig- Returns:
- time in milliseconds indicating the interval.
-
getWaitTimeInMsWhenSyncEmpty
public int getWaitTimeInMsWhenSyncEmpty()
Description copied from interface:EurekaServerConfigGets the time to wait when the eureka server starts up unable to get instances from peer nodes. It is better not to start serving rightaway during these scenarios as the information that is stored in the registry may not be complete. When the instance registry starts up empty, it builds over time when the clients start to send heartbeats and the server requests the clients for registration information.- Specified by:
getWaitTimeInMsWhenSyncEmptyin interfaceEurekaServerConfig- Returns:
- time in milliseconds.
-
getPeerNodeConnectTimeoutMs
public int getPeerNodeConnectTimeoutMs()
Description copied from interface:EurekaServerConfigGets the timeout value for connecting to peer eureka nodes for replication.- Specified by:
getPeerNodeConnectTimeoutMsin interfaceEurekaServerConfig- Returns:
- timeout value in milliseconds.
-
getPeerNodeReadTimeoutMs
public int getPeerNodeReadTimeoutMs()
Description copied from interface:EurekaServerConfigGets the timeout value for reading information from peer eureka nodes for replication.- Specified by:
getPeerNodeReadTimeoutMsin interfaceEurekaServerConfig- Returns:
- timeout value in milliseconds.
-
getPeerNodeTotalConnections
public int getPeerNodeTotalConnections()
Description copied from interface:EurekaServerConfigGets the total number of HTTP connections allowed to peer eureka nodes for replication.- Specified by:
getPeerNodeTotalConnectionsin interfaceEurekaServerConfig- Returns:
- total number of allowed HTTP connections.
-
getPeerNodeTotalConnectionsPerHost
public int getPeerNodeTotalConnectionsPerHost()
Description copied from interface:EurekaServerConfigGets the total number of HTTP connections allowed to a particular peer eureka node for replication.- Specified by:
getPeerNodeTotalConnectionsPerHostin interfaceEurekaServerConfig- Returns:
- total number of allowed HTTP connections for a peer node.
-
getPeerNodeConnectionIdleTimeoutSeconds
public int getPeerNodeConnectionIdleTimeoutSeconds()
Description copied from interface:EurekaServerConfigGets the idle time after which the HTTP connection should be cleaned up.- Specified by:
getPeerNodeConnectionIdleTimeoutSecondsin interfaceEurekaServerConfig- Returns:
- idle time in seconds.
-
getRetentionTimeInMSInDeltaQueue
public long getRetentionTimeInMSInDeltaQueue()
Description copied from interface:EurekaServerConfigGet the time for which the delta information should be cached for the clients to retrieve the value without missing it.- Specified by:
getRetentionTimeInMSInDeltaQueuein interfaceEurekaServerConfig- Returns:
- time in milliseconds
-
getDeltaRetentionTimerIntervalInMs
public long getDeltaRetentionTimerIntervalInMs()
Description copied from interface:EurekaServerConfigGet the time interval with which the clean up task should wake up and check for expired delta information.- Specified by:
getDeltaRetentionTimerIntervalInMsin interfaceEurekaServerConfig- Returns:
- time in milliseconds.
-
getEvictionIntervalTimerInMs
public long getEvictionIntervalTimerInMs()
Description copied from interface:EurekaServerConfigGet the time interval with which the task that expires instances should wake up and run.- Specified by:
getEvictionIntervalTimerInMsin interfaceEurekaServerConfig- Returns:
- time in milliseconds.
-
shouldUseAwsAsgApi
public boolean shouldUseAwsAsgApi()
Description copied from interface:EurekaServerConfigWhether to use AWS API to query ASG statuses.- Specified by:
shouldUseAwsAsgApiin interfaceEurekaServerConfig- Returns:
- true if AWS API is used, false otherwise.
-
getASGQueryTimeoutMs
public int getASGQueryTimeoutMs()
Description copied from interface:EurekaServerConfigGet the timeout value for querying the AWS for ASG information.- Specified by:
getASGQueryTimeoutMsin interfaceEurekaServerConfig- Returns:
- timeout value in milliseconds.
-
getASGUpdateIntervalMs
public long getASGUpdateIntervalMs()
Description copied from interface:EurekaServerConfigGet the time interval with which the ASG information must be queried from AWS.- Specified by:
getASGUpdateIntervalMsin interfaceEurekaServerConfig- Returns:
- time in milliseconds.
-
getASGCacheExpiryTimeoutMs
public long getASGCacheExpiryTimeoutMs()
Description copied from interface:EurekaServerConfigGet the expiration value for the cached ASG information- Specified by:
getASGCacheExpiryTimeoutMsin interfaceEurekaServerConfig- Returns:
- time in milliseconds.
-
getResponseCacheAutoExpirationInSeconds
public long getResponseCacheAutoExpirationInSeconds()
Description copied from interface:EurekaServerConfigGets the time for which the registry payload should be kept in the cache if it is not invalidated by change events.- Specified by:
getResponseCacheAutoExpirationInSecondsin interfaceEurekaServerConfig- Returns:
- time in seconds.
-
getResponseCacheUpdateIntervalMs
public long getResponseCacheUpdateIntervalMs()
Description copied from interface:EurekaServerConfigGets the time interval with which the payload cache of the client should be updated.- Specified by:
getResponseCacheUpdateIntervalMsin interfaceEurekaServerConfig- Returns:
- time in milliseconds.
-
shouldUseReadOnlyResponseCache
public boolean shouldUseReadOnlyResponseCache()
Description copied from interface:EurekaServerConfigTheResponseCachecurrently uses a two level caching strategy to responses. A readWrite cache with an expiration policy, and a readonly cache that caches without expiry.- Specified by:
shouldUseReadOnlyResponseCachein interfaceEurekaServerConfig- Returns:
- true if the read only cache is to be used
-
shouldDisableDelta
public boolean shouldDisableDelta()
Description copied from interface:EurekaServerConfigChecks to see if the delta information can be served to client or not.The changes are effective at runtime.
- Specified by:
shouldDisableDeltain interfaceEurekaServerConfig- Returns:
- true if the delta information is allowed to be served, false otherwise.
-
getMaxIdleThreadInMinutesAgeForStatusReplication
public long getMaxIdleThreadInMinutesAgeForStatusReplication()
Description copied from interface:EurekaServerConfigGet the idle time for which the status replication threads can stay alive.- Specified by:
getMaxIdleThreadInMinutesAgeForStatusReplicationin interfaceEurekaServerConfig- Returns:
- time in minutes.
-
getMinThreadsForStatusReplication
public int getMinThreadsForStatusReplication()
Description copied from interface:EurekaServerConfigGet the minimum number of threads to be used for status replication.- Specified by:
getMinThreadsForStatusReplicationin interfaceEurekaServerConfig- Returns:
- minimum number of threads to be used for status replication.
-
getMaxThreadsForStatusReplication
public int getMaxThreadsForStatusReplication()
Description copied from interface:EurekaServerConfigGet the maximum number of threads to be used for status replication.- Specified by:
getMaxThreadsForStatusReplicationin interfaceEurekaServerConfig- Returns:
- maximum number of threads to be used for status replication.
-
getMaxElementsInStatusReplicationPool
public int getMaxElementsInStatusReplicationPool()
Description copied from interface:EurekaServerConfigGet the maximum number of replication events that can be allowed to back up in the status replication pool.Depending on the memory allowed, timeout and the replication traffic, this value can vary.
- Specified by:
getMaxElementsInStatusReplicationPoolin interfaceEurekaServerConfig- Returns:
- the maximum number of replication events that can be allowed to back up.
-
shouldSyncWhenTimestampDiffers
public boolean shouldSyncWhenTimestampDiffers()
Description copied from interface:EurekaServerConfigChecks whether to synchronize instances when timestamp differs.The changes are effective at runtime.
- Specified by:
shouldSyncWhenTimestampDiffersin interfaceEurekaServerConfig- Returns:
- true, to synchronize, false otherwise.
-
getRegistrySyncRetries
public int getRegistrySyncRetries()
Description copied from interface:EurekaServerConfigGet the number of times that a eureka node would try to get the registry information from the peers during startup.- Specified by:
getRegistrySyncRetriesin interfaceEurekaServerConfig- Returns:
- the number of retries
-
getRegistrySyncRetryWaitMs
public long getRegistrySyncRetryWaitMs()
Description copied from interface:EurekaServerConfigGet the wait/sleep time between each retry sync attempts, if the prev retry failed and there are more retries to attempt.- Specified by:
getRegistrySyncRetryWaitMsin interfaceEurekaServerConfig- Returns:
- the wait time in ms between each sync retries
-
getMaxElementsInPeerReplicationPool
public int getMaxElementsInPeerReplicationPool()
Description copied from interface:EurekaServerConfigGet the maximum number of replication events that can be allowed to back up in the replication pool. This replication pool is responsible for all events except status updates.Depending on the memory allowed, timeout and the replication traffic, this value can vary.
- Specified by:
getMaxElementsInPeerReplicationPoolin interfaceEurekaServerConfig- Returns:
- the maximum number of replication events that can be allowed to back up.
-
getMaxIdleThreadAgeInMinutesForPeerReplication
public long getMaxIdleThreadAgeInMinutesForPeerReplication()
Description copied from interface:EurekaServerConfigGet the idle time for which the replication threads can stay alive.- Specified by:
getMaxIdleThreadAgeInMinutesForPeerReplicationin interfaceEurekaServerConfig- Returns:
- time in minutes.
-
getMinThreadsForPeerReplication
public int getMinThreadsForPeerReplication()
Description copied from interface:EurekaServerConfigGet the minimum number of threads to be used for replication.- Specified by:
getMinThreadsForPeerReplicationin interfaceEurekaServerConfig- Returns:
- minimum number of threads to be used for replication.
-
getMaxThreadsForPeerReplication
public int getMaxThreadsForPeerReplication()
Description copied from interface:EurekaServerConfigGet the maximum number of threads to be used for replication.- Specified by:
getMaxThreadsForPeerReplicationin interfaceEurekaServerConfig- Returns:
- maximum number of threads to be used for replication.
-
getMaxTimeForReplication
public int getMaxTimeForReplication()
Description copied from interface:EurekaServerConfigGet the time in milliseconds to try to replicate before dropping replication events.- Specified by:
getMaxTimeForReplicationin interfaceEurekaServerConfig- Returns:
- time in milliseconds
-
shouldPrimeAwsReplicaConnections
public boolean shouldPrimeAwsReplicaConnections()
Description copied from interface:EurekaServerConfigChecks whether the connections to replicas should be primed. In AWS, the firewall requires sometime to establish network connection for new nodes.- Specified by:
shouldPrimeAwsReplicaConnectionsin interfaceEurekaServerConfig- Returns:
- true, if connections should be primed, false otherwise.
-
shouldDisableDeltaForRemoteRegions
public boolean shouldDisableDeltaForRemoteRegions()
Description copied from interface:EurekaServerConfigChecks to see if the delta information can be served to client or not for remote regions.The changes are effective at runtime.
- Specified by:
shouldDisableDeltaForRemoteRegionsin interfaceEurekaServerConfig- Returns:
- true if the delta information is allowed to be served, false otherwise.
-
getRemoteRegionConnectTimeoutMs
public int getRemoteRegionConnectTimeoutMs()
Description copied from interface:EurekaServerConfigGets the timeout value for connecting to peer eureka nodes for remote regions.- Specified by:
getRemoteRegionConnectTimeoutMsin interfaceEurekaServerConfig- Returns:
- timeout value in milliseconds.
-
getRemoteRegionReadTimeoutMs
public int getRemoteRegionReadTimeoutMs()
Description copied from interface:EurekaServerConfigGets the timeout value for reading information from peer eureka nodes for remote regions.- Specified by:
getRemoteRegionReadTimeoutMsin interfaceEurekaServerConfig- Returns:
- timeout value in milliseconds.
-
getRemoteRegionTotalConnections
public int getRemoteRegionTotalConnections()
Description copied from interface:EurekaServerConfigGets the total number of HTTP connections allowed to peer eureka nodes for remote regions.- Specified by:
getRemoteRegionTotalConnectionsin interfaceEurekaServerConfig- Returns:
- total number of allowed HTTP connections.
-
getRemoteRegionTotalConnectionsPerHost
public int getRemoteRegionTotalConnectionsPerHost()
Description copied from interface:EurekaServerConfigGets the total number of HTTP connections allowed to a particular peer eureka node for remote regions.- Specified by:
getRemoteRegionTotalConnectionsPerHostin interfaceEurekaServerConfig- Returns:
- total number of allowed HTTP connections for a peer node.
-
getRemoteRegionConnectionIdleTimeoutSeconds
public int getRemoteRegionConnectionIdleTimeoutSeconds()
Description copied from interface:EurekaServerConfigGets the idle time after which the HTTP connection should be cleaned up for remote regions.- Specified by:
getRemoteRegionConnectionIdleTimeoutSecondsin interfaceEurekaServerConfig- Returns:
- idle time in seconds.
-
shouldGZipContentFromRemoteRegion
public boolean shouldGZipContentFromRemoteRegion()
Description copied from interface:EurekaServerConfigIndicates whether the content fetched from eureka server has to be compressed for remote regions whenever it is supported by the server. The registry information from the eureka server is compressed for optimum network traffic.- Specified by:
shouldGZipContentFromRemoteRegionin interfaceEurekaServerConfig- Returns:
- true, if the content need to be compressed, false otherwise.
-
getRemoteRegionUrlsWithName
public java.util.Map<java.lang.String,java.lang.String> getRemoteRegionUrlsWithName()
Expects a property with name: [eureka-namespace].remoteRegionUrlsWithName and a value being a comma separated list of region name & remote url pairs, separated with a ";".
So, if you wish to specify two regions with name region1 & region2, the property value will be:eureka.remoteRegionUrlsWithName=region1;http://region1host/eureka/v2,region2;http://region2host/eureka/v2The above property will result in the following map:region1->"http://region1host/eureka/v2" region2->"http://region2host/eureka/v2"- Specified by:
getRemoteRegionUrlsWithNamein interfaceEurekaServerConfig- Returns:
- A map of region name to remote region URL parsed from the property specified above. If there is no property available, then an empty map is returned.
-
getRemoteRegionUrls
public java.lang.String[] getRemoteRegionUrls()
Description copied from interface:EurekaServerConfigGet the list of remote region urls.- Specified by:
getRemoteRegionUrlsin interfaceEurekaServerConfig- Returns:
- - array of string representing
URLs.
-
getRemoteRegionAppWhitelist
@Nullable public java.util.Set<java.lang.String> getRemoteRegionAppWhitelist(@Nullable java.lang.String regionName)Description copied from interface:EurekaServerConfigReturns a list of applications that must be retrieved from the passed remote region.
This list can benullwhich means that no filtering should be applied on the applications for this region i.e. all applications must be returned.
A global whitelist can also be configured which can be used when no setting is available for a region, such a whitelist can be obtained by passingnullto this method.- Specified by:
getRemoteRegionAppWhitelistin interfaceEurekaServerConfig- Parameters:
regionName- Name of the region for which the application whitelist is to be retrieved. If null a global setting is returned.- Returns:
- A set of application names which must be retrieved from the passed region. If
nullall applications must be retrieved.
-
getRemoteRegionRegistryFetchInterval
public int getRemoteRegionRegistryFetchInterval()
Description copied from interface:EurekaServerConfigGet the time interval for which the registry information need to be fetched from the remote region.- Specified by:
getRemoteRegionRegistryFetchIntervalin interfaceEurekaServerConfig- Returns:
- time in seconds.
-
getRemoteRegionFetchThreadPoolSize
public int getRemoteRegionFetchThreadPoolSize()
Description copied from interface:EurekaServerConfigSize of a thread pool used to execute remote region registry fetch requests. Delegating these requests to internal threads is necessary workaround to https://bugs.openjdk.java.net/browse/JDK-8049846 bug.- Specified by:
getRemoteRegionFetchThreadPoolSizein interfaceEurekaServerConfig
-
getRemoteRegionTrustStore
public java.lang.String getRemoteRegionTrustStore()
Description copied from interface:EurekaServerConfigGets the fully qualified trust store file that will be used for remote region registry fetches.- Specified by:
getRemoteRegionTrustStorein interfaceEurekaServerConfig- Returns:
-
getRemoteRegionTrustStorePassword
public java.lang.String getRemoteRegionTrustStorePassword()
Description copied from interface:EurekaServerConfigGet the remote region trust store's password.- Specified by:
getRemoteRegionTrustStorePasswordin interfaceEurekaServerConfig
-
disableTransparentFallbackToOtherRegion
public boolean disableTransparentFallbackToOtherRegion()
Description copied from interface:EurekaServerConfigOld behavior of fallback to applications in the remote region (if configured) if there are no instances of that application in the local region, will be disabled.- Specified by:
disableTransparentFallbackToOtherRegionin interfaceEurekaServerConfig- Returns:
trueif the old behavior is to be disabled.
-
shouldBatchReplication
public boolean shouldBatchReplication()
Description copied from interface:EurekaServerConfigIndicates whether the replication between cluster nodes should be batched for network efficiency.- Specified by:
shouldBatchReplicationin interfaceEurekaServerConfig- Returns:
trueif the replication needs to be batched.
-
getMyUrl
public java.lang.String getMyUrl()
Description copied from interface:EurekaServerConfigAllows to configure URL which Eureka should treat as its own during replication. In some cases Eureka URLs don't match IP address or hostname (for example, when nodes are behind load balancers). Setting this parameter on each node to URLs of associated load balancers helps to avoid replication to the same node where event originally came to. Important: you need to configure the whole URL including scheme and path, likehttp://eureka-node1.mydomain.com:8010/eureka/v2/- Specified by:
getMyUrlin interfaceEurekaServerConfig- Returns:
- URL Eureka will treat as its own
-
shouldLogIdentityHeaders
public boolean shouldLogIdentityHeaders()
Description copied from interface:EurekaServerConfigIndicates whether the eureka server should log/metric clientAuthHeaders- Specified by:
shouldLogIdentityHeadersin interfaceEurekaServerConfig- Returns:
trueif the clientAuthHeaders should be logged and/or emitted as metrics
-
getJsonCodecName
public java.lang.String getJsonCodecName()
- Specified by:
getJsonCodecNamein interfaceEurekaServerConfig- Returns:
- the class name of the full json codec to use for the server. If none set a default codec will be used
-
getXmlCodecName
public java.lang.String getXmlCodecName()
- Specified by:
getXmlCodecNamein interfaceEurekaServerConfig- Returns:
- the class name of the full xml codec to use for the server. If none set a default codec will be used
-
isRateLimiterEnabled
public boolean isRateLimiterEnabled()
Description copied from interface:EurekaServerConfigIndicates whether the rate limiter should be enabled or disabled.- Specified by:
isRateLimiterEnabledin interfaceEurekaServerConfig
-
isRateLimiterThrottleStandardClients
public boolean isRateLimiterThrottleStandardClients()
Description copied from interface:EurekaServerConfigIndicate if rate limit standard clients. If set to false, only non standard clients will be rate limited.- Specified by:
isRateLimiterThrottleStandardClientsin interfaceEurekaServerConfig
-
getRateLimiterPrivilegedClients
public java.util.Set<java.lang.String> getRateLimiterPrivilegedClients()
Description copied from interface:EurekaServerConfigA list of certified clients. This is in addition to standard eureka Java clients.- Specified by:
getRateLimiterPrivilegedClientsin interfaceEurekaServerConfig
-
getRateLimiterBurstSize
public int getRateLimiterBurstSize()
Description copied from interface:EurekaServerConfigRate limiter, token bucket algorithm property. See alsoEurekaServerConfig.getRateLimiterRegistryFetchAverageRate()andEurekaServerConfig.getRateLimiterFullFetchAverageRate().- Specified by:
getRateLimiterBurstSizein interfaceEurekaServerConfig
-
getRateLimiterRegistryFetchAverageRate
public int getRateLimiterRegistryFetchAverageRate()
Description copied from interface:EurekaServerConfigRate limiter, token bucket algorithm property. Specifies the average enforced request rate. See alsoEurekaServerConfig.getRateLimiterBurstSize().- Specified by:
getRateLimiterRegistryFetchAverageRatein interfaceEurekaServerConfig
-
getRateLimiterFullFetchAverageRate
public int getRateLimiterFullFetchAverageRate()
Description copied from interface:EurekaServerConfigRate limiter, token bucket algorithm property. Specifies the average enforced request rate. See alsoEurekaServerConfig.getRateLimiterBurstSize().- Specified by:
getRateLimiterFullFetchAverageRatein interfaceEurekaServerConfig
-
getListAutoScalingGroupsRoleName
public java.lang.String getListAutoScalingGroupsRoleName()
Description copied from interface:EurekaServerConfigName of the Role used to describe auto scaling groups from third AWS accounts.- Specified by:
getListAutoScalingGroupsRoleNamein interfaceEurekaServerConfig
-
getRoute53BindRebindRetries
public int getRoute53BindRebindRetries()
Description copied from interface:EurekaServerConfigGets the number of times the server should try to bind to the candidate Route53 domain.The changes are effective at runtime.
- Specified by:
getRoute53BindRebindRetriesin interfaceEurekaServerConfig- Returns:
- the number of times the server should try to bind to the candidate Route53 domain.
-
getRoute53BindingRetryIntervalMs
public int getRoute53BindingRetryIntervalMs()
Description copied from interface:EurekaServerConfigGets the interval with which the server should check if the Route53 domain is bound and should try to bind in the case if it is already not bound.The changes are effective at runtime.
- Specified by:
getRoute53BindingRetryIntervalMsin interfaceEurekaServerConfig- Returns:
- the time in milliseconds.
-
getRoute53DomainTTL
public long getRoute53DomainTTL()
- Specified by:
getRoute53DomainTTLin interfaceEurekaServerConfig- Returns:
- the ttl used to set up the route53 domain if new
-
getBindingStrategy
public AwsBindingStrategy getBindingStrategy()
Description copied from interface:EurekaServerConfigGet the configured binding strategy EIP or Route53.- Specified by:
getBindingStrategyin interfaceEurekaServerConfig- Returns:
- the configured binding strategy
-
getExperimental
public java.lang.String getExperimental(java.lang.String name)
Description copied from interface:EurekaServerConfigTo avoid configuration API pollution when trying new/experimental or features or for the migration process, the corresponding configuration can be put into experimental configuration section.- Specified by:
getExperimentalin interfaceEurekaServerConfig- Returns:
- a property of experimental feature
-
getHealthStatusMinNumberOfAvailablePeers
public int getHealthStatusMinNumberOfAvailablePeers()
Description copied from interface:EurekaServerConfigGet the minimum number of available peer replication instances for this instance to be considered healthy. The design of eureka allows for an instance to continue operating with zero peers, but that would not be ideal.The default value of -1 is interpreted as a marker to not compare the number of replicas. This would be done to either disable this check or to run eureka in a single node configuration.
- Specified by:
getHealthStatusMinNumberOfAvailablePeersin interfaceEurekaServerConfig- Returns:
- minimum number of available peer replication instances for this instance to be considered healthy.
-
getInitialCapacityOfResponseCache
public int getInitialCapacityOfResponseCache()
Description copied from interface:EurekaServerConfigGet the capacity of responseCache, default value is 1000.- Specified by:
getInitialCapacityOfResponseCachein interfaceEurekaServerConfig- Returns:
- the capacity of responseCache.
-
-