public class DefaultEurekaServerConfig extends java.lang.Object implements EurekaServerConfig
EurekaServerConfig.
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-
| Constructor and Description |
|---|
DefaultEurekaServerConfig() |
DefaultEurekaServerConfig(java.lang.String namespace) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
disableTransparentFallbackToOtherRegion()
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.
|
int |
getASGQueryTimeoutMs()
Get the timeout value for querying the AWS for ASG
information.
|
long |
getASGUpdateIntervalMs()
Get the time interval with which the ASG information must be
queried from AWS.
|
java.lang.String |
getAWSAccessId()
Gets the AWS Access Id.
|
java.lang.String |
getAWSSecretKey()
Gets the AWS Secret Key.
|
long |
getDeltaRetentionTimerIntervalInMs()
Get the time interval with which the clean up task should wake up and
check for expired delta information.
|
int |
getEIPBindingRetryIntervalMs()
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.
|
int |
getEIPBindRebindRetries()
Gets the number of times the server should try to bind to the candidate
EIP.
|
long |
getEvictionIntervalTimerInMs()
Get the time interval with which the task that expires instances should
wake up and run.
|
int |
getMaxElementsInPeerReplicationPool()
Get the maximum number of replication events that can be allowed to back
up in the replication pool.
|
int |
getMaxElementsInStatusReplicationPool()
Get the maximum number of replication events that can be allowed to back
up in the status replication pool.
|
long |
getMaxIdleThreadAgeInMinutesForPeerReplication()
Get the idle time for which the replication threads can stay alive.
|
long |
getMaxIdleThreadInMinutesAgeForStatusReplication()
Get the idle time for which the status replication threads can stay
alive.
|
int |
getMaxThreadsForPeerReplication()
Get the maximum number of threads to be used for replication.
|
int |
getMaxThreadsForStatusReplication()
Get the maximum number of threads to be used for status replication.
|
int |
getMaxTimeForReplication()
Get the time in milliseconds to try to replicate before dropping
replication events.
|
int |
getMinThreadsForPeerReplication()
Get the minimum number of threads to be used for replication.
|
int |
getMinThreadsForStatusReplication()
Get the minimum number of threads to be used for status replication.
|
int |
getNumberOfReplicationRetries()
Get the number of times the replication events should be retried with
peers.
|
int |
getPeerEurekaNodesUpdateIntervalMs()
The interval with which the information about the changes in peer eureka
nodes is updated.
|
int |
getPeerEurekaStatusRefreshTimeIntervalMs()
Gets the interval with which the status information about peer nodes is
updated.
|
int |
getPeerNodeConnectionIdleTimeoutSeconds()
Gets the idle time after which the HTTP connection should be
cleaned up.
|
int |
getPeerNodeConnectTimeoutMs()
Gets the timeout value for connecting to peer eureka nodes for
replication.
|
int |
getPeerNodeReadTimeoutMs()
Gets the timeout value for reading information from peer eureka nodes for
replication.
|
int |
getPeerNodeTotalConnections()
Gets the total number of HTTP connections allowed to peer eureka
nodes for replication.
|
int |
getPeerNodeTotalConnectionsPerHost()
Gets the total number of HTTP connections allowed to a
particular peer eureka node for replication.
|
int |
getRegistrySyncRetries()
Get the number of times that a eureka node would try to get the registry
information from the peers during startup.
|
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.
|
int |
getRemoteRegionConnectionIdleTimeoutSeconds()
Gets the idle time after which the HTTP connection should be
cleaned up for remote regions.
|
int |
getRemoteRegionConnectTimeoutMs()
Gets the timeout value for connecting to peer eureka nodes for remote
regions.
|
int |
getRemoteRegionReadTimeoutMs()
Gets the timeout value for reading information from peer eureka nodes for
remote regions.
|
int |
getRemoteRegionRegistryFetchInterval()
Get the time interval for which the registry information need to be fetched from the remote region.
|
int |
getRemoteRegionTotalConnections()
Gets the total number of HTTP connections allowed to peer eureka
nodes for remote regions.
|
int |
getRemoteRegionTotalConnectionsPerHost()
Gets the total number of HTTP connections allowed to a
particular peer eureka node for remote regions.
|
java.lang.String |
getRemoteRegionTrustStore()
Gets the fully qualified trust store file that will be used for remote region registry fetches.
|
java.lang.String |
getRemoteRegionTrustStorePassword()
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 ";".
|
double |
getRenewalPercentThreshold()
The minimum percentage of renewals that is expected from the clients in
the period specified by
EurekaServerConfig.getRenewalThresholdUpdateIntervalMs(). |
int |
getRenewalThresholdUpdateIntervalMs()
The interval with which the threshold as specified in
EurekaServerConfig.getRenewalPercentThreshold() needs to be updated. |
long |
getResponseCacheAutoExpirationInSeconds()
Gets the time for which the registry payload should be kept in the cache
if it is not invalidated by change events.
|
long |
getResponseCacheUpdateIntervalMs()
Gets the time interval with which the payload cache of the client should
be updated.
|
long |
getRetentionTimeInMSInDeltaQueue()
Get the time for which the delta information should be cached for the
clients to retrieve the value without missing it.
|
int |
getWaitTimeInMsWhenSyncEmpty()
Gets the time to wait when the eureka server starts up unable to get
instances from peer nodes.
|
boolean |
shouldBatchReplication()
Indicates whether the replication between cluster nodes should be batched for network efficiency.
|
boolean |
shouldDisableDelta()
Checks to see if the delta information can be served to client or not.
|
boolean |
shouldDisableDeltaForRemoteRegions()
Checks to see if the delta information can be served to client or not for
remote regions.
|
boolean |
shouldEnableSelfPreservation()
Checks to see if the eureka server is enabled for self preservation.
|
boolean |
shouldGZipContentFromRemoteRegion()
Indicates whether the content fetched from eureka server has to be
compressed for remote regions whenever it is supported by the server.
|
boolean |
shouldLogIdentityHeaders()
Indicates whether the eureka server should log/metric clientAuthHeaders
|
boolean |
shouldPrimeAwsReplicaConnections()
Checks whether the connections to replicas should be primed.
|
boolean |
shouldSyncWhenTimestampDiffers()
Checks whether to synchronize instances when timestamp differs.
|
public DefaultEurekaServerConfig()
public DefaultEurekaServerConfig(java.lang.String namespace)
public java.lang.String getAWSAccessId()
EurekaServerConfiggetAWSAccessId in interface EurekaServerConfigpublic java.lang.String getAWSSecretKey()
EurekaServerConfiggetAWSSecretKey in interface EurekaServerConfigpublic int getEIPBindRebindRetries()
EurekaServerConfigThe changes are effective at runtime.
getEIPBindRebindRetries in interface EurekaServerConfigpublic int getEIPBindingRetryIntervalMs()
EurekaServerConfigThe changes are effective at runtime.
getEIPBindingRetryIntervalMs in interface EurekaServerConfigpublic boolean shouldEnableSelfPreservation()
EurekaServerConfig
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.
shouldEnableSelfPreservation in interface EurekaServerConfigpublic int getPeerEurekaNodesUpdateIntervalMs()
EurekaServerConfigThe changes are effective at runtime.
getPeerEurekaNodesUpdateIntervalMs in interface EurekaServerConfigpublic int getRenewalThresholdUpdateIntervalMs()
EurekaServerConfigEurekaServerConfig.getRenewalPercentThreshold() needs to be updated.getRenewalThresholdUpdateIntervalMs in interface EurekaServerConfigpublic double getRenewalPercentThreshold()
EurekaServerConfigEurekaServerConfig.getRenewalThresholdUpdateIntervalMs().
If the renewals drop below the threshold, the expirations are disabled if
the EurekaServerConfig.shouldEnableSelfPreservation() is enabled.
The changes are effective at runtime.
getRenewalPercentThreshold in interface EurekaServerConfig85% will be specified as 0.85.public int getNumberOfReplicationRetries()
EurekaServerConfigThe changes are effective at runtime.
getNumberOfReplicationRetries in interface EurekaServerConfigpublic int getPeerEurekaStatusRefreshTimeIntervalMs()
EurekaServerConfigThe changes are effective at runtime.
getPeerEurekaStatusRefreshTimeIntervalMs in interface EurekaServerConfigpublic int getWaitTimeInMsWhenSyncEmpty()
EurekaServerConfiggetWaitTimeInMsWhenSyncEmpty in interface EurekaServerConfigpublic int getPeerNodeConnectTimeoutMs()
EurekaServerConfiggetPeerNodeConnectTimeoutMs in interface EurekaServerConfigpublic int getPeerNodeReadTimeoutMs()
EurekaServerConfiggetPeerNodeReadTimeoutMs in interface EurekaServerConfigpublic int getPeerNodeTotalConnections()
EurekaServerConfiggetPeerNodeTotalConnections in interface EurekaServerConfigpublic int getPeerNodeTotalConnectionsPerHost()
EurekaServerConfiggetPeerNodeTotalConnectionsPerHost in interface EurekaServerConfigpublic int getPeerNodeConnectionIdleTimeoutSeconds()
EurekaServerConfiggetPeerNodeConnectionIdleTimeoutSeconds in interface EurekaServerConfigpublic long getRetentionTimeInMSInDeltaQueue()
EurekaServerConfiggetRetentionTimeInMSInDeltaQueue in interface EurekaServerConfigpublic long getDeltaRetentionTimerIntervalInMs()
EurekaServerConfiggetDeltaRetentionTimerIntervalInMs in interface EurekaServerConfigpublic long getEvictionIntervalTimerInMs()
EurekaServerConfiggetEvictionIntervalTimerInMs in interface EurekaServerConfigpublic int getASGQueryTimeoutMs()
EurekaServerConfiggetASGQueryTimeoutMs in interface EurekaServerConfigpublic long getASGUpdateIntervalMs()
EurekaServerConfiggetASGUpdateIntervalMs in interface EurekaServerConfigpublic long getResponseCacheAutoExpirationInSeconds()
EurekaServerConfiggetResponseCacheAutoExpirationInSeconds in interface EurekaServerConfigpublic long getResponseCacheUpdateIntervalMs()
EurekaServerConfiggetResponseCacheUpdateIntervalMs in interface EurekaServerConfigpublic boolean shouldDisableDelta()
EurekaServerConfigThe changes are effective at runtime.
shouldDisableDelta in interface EurekaServerConfigpublic long getMaxIdleThreadInMinutesAgeForStatusReplication()
EurekaServerConfiggetMaxIdleThreadInMinutesAgeForStatusReplication in interface EurekaServerConfigpublic int getMinThreadsForStatusReplication()
EurekaServerConfiggetMinThreadsForStatusReplication in interface EurekaServerConfigpublic int getMaxThreadsForStatusReplication()
EurekaServerConfiggetMaxThreadsForStatusReplication in interface EurekaServerConfigpublic int getMaxElementsInStatusReplicationPool()
EurekaServerConfigDepending on the memory allowed, timeout and the replication traffic, this value can vary.
getMaxElementsInStatusReplicationPool in interface EurekaServerConfigpublic boolean shouldSyncWhenTimestampDiffers()
EurekaServerConfigThe changes are effective at runtime.
shouldSyncWhenTimestampDiffers in interface EurekaServerConfigpublic int getRegistrySyncRetries()
EurekaServerConfiggetRegistrySyncRetries in interface EurekaServerConfigpublic int getMaxElementsInPeerReplicationPool()
EurekaServerConfigDepending on the memory allowed, timeout and the replication traffic, this value can vary.
getMaxElementsInPeerReplicationPool in interface EurekaServerConfigpublic long getMaxIdleThreadAgeInMinutesForPeerReplication()
EurekaServerConfiggetMaxIdleThreadAgeInMinutesForPeerReplication in interface EurekaServerConfigpublic int getMinThreadsForPeerReplication()
EurekaServerConfiggetMinThreadsForPeerReplication in interface EurekaServerConfigpublic int getMaxThreadsForPeerReplication()
EurekaServerConfiggetMaxThreadsForPeerReplication in interface EurekaServerConfigpublic int getMaxTimeForReplication()
EurekaServerConfiggetMaxTimeForReplication in interface EurekaServerConfigpublic boolean shouldPrimeAwsReplicaConnections()
EurekaServerConfigshouldPrimeAwsReplicaConnections in interface EurekaServerConfigpublic boolean shouldDisableDeltaForRemoteRegions()
EurekaServerConfigThe changes are effective at runtime.
shouldDisableDeltaForRemoteRegions in interface EurekaServerConfigpublic int getRemoteRegionConnectTimeoutMs()
EurekaServerConfiggetRemoteRegionConnectTimeoutMs in interface EurekaServerConfigpublic int getRemoteRegionReadTimeoutMs()
EurekaServerConfiggetRemoteRegionReadTimeoutMs in interface EurekaServerConfigpublic int getRemoteRegionTotalConnections()
EurekaServerConfiggetRemoteRegionTotalConnections in interface EurekaServerConfigpublic int getRemoteRegionTotalConnectionsPerHost()
EurekaServerConfiggetRemoteRegionTotalConnectionsPerHost in interface EurekaServerConfigpublic int getRemoteRegionConnectionIdleTimeoutSeconds()
EurekaServerConfiggetRemoteRegionConnectionIdleTimeoutSeconds in interface EurekaServerConfigpublic boolean shouldGZipContentFromRemoteRegion()
EurekaServerConfigshouldGZipContentFromRemoteRegion in interface EurekaServerConfigpublic java.util.Map<java.lang.String,java.lang.String> getRemoteRegionUrlsWithName()
eureka.remoteRegionUrlsWithName=region1;http://region1host/eureka/v2,region2;http://region2host/eureka/v2
The above property will result in the following map:
region1->"http://region1host/eureka/v2"
region2->"http://region2host/eureka/v2"
getRemoteRegionUrlsWithName in interface EurekaServerConfigpublic java.lang.String[] getRemoteRegionUrls()
EurekaServerConfiggetRemoteRegionUrls in interface EurekaServerConfigURLs.@Nullable
public java.util.Set<java.lang.String> getRemoteRegionAppWhitelist(@Nullable
java.lang.String regionName)
EurekaServerConfignull which means that no filtering should be applied on the applications
for this region i.e. all applications must be returned. null to this method.getRemoteRegionAppWhitelist in interface EurekaServerConfigregionName - Name of the region for which the application whitelist is to be retrieved. If null a global
setting is returned.null all
applications must be retrieved.public int getRemoteRegionRegistryFetchInterval()
EurekaServerConfiggetRemoteRegionRegistryFetchInterval in interface EurekaServerConfigpublic java.lang.String getRemoteRegionTrustStore()
EurekaServerConfiggetRemoteRegionTrustStore in interface EurekaServerConfigpublic java.lang.String getRemoteRegionTrustStorePassword()
EurekaServerConfiggetRemoteRegionTrustStorePassword in interface EurekaServerConfigpublic boolean disableTransparentFallbackToOtherRegion()
EurekaServerConfigdisableTransparentFallbackToOtherRegion in interface EurekaServerConfigtrue if the old behavior is to be disabled.public boolean shouldBatchReplication()
EurekaServerConfigshouldBatchReplication in interface EurekaServerConfigtrue if the replication needs to be batched.public boolean shouldLogIdentityHeaders()
EurekaServerConfigshouldLogIdentityHeaders in interface EurekaServerConfigtrue if the clientAuthHeaders should be logged and/or emitted as metrics