Interface EurekaServerConfig

  • All Known Implementing Classes:
    DefaultEurekaServerConfig

    public interface EurekaServerConfig
    Configuration information required by the eureka server to operate.

    Most of the required information is provided by the default configuration DefaultEurekaServerConfig. Note that all configurations are not effective at runtime unless and otherwise specified.

    • Method Detail

      • getAWSAccessId

        java.lang.String getAWSAccessId()
        Gets 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.
        Returns:
      • getAWSSecretKey

        java.lang.String getAWSSecretKey()
        Gets 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.
        Returns:
      • getEIPBindRebindRetries

        int getEIPBindRebindRetries()
        Gets the number of times the server should try to bind to the candidate EIP.

        The changes are effective at runtime.

        Returns:
        the number of times the server should try to bind to the candidate EIP.
      • getEIPBindingRetryIntervalMsWhenUnbound

        int getEIPBindingRetryIntervalMsWhenUnbound()
        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.

        The changes are effective at runtime.

        Returns:
        the time in milliseconds.
      • getEIPBindingRetryIntervalMs

        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, iff the EIP is already bound. (so this refresh is just for steady state checks)

        The changes are effective at runtime.

        Returns:
        the time in milliseconds.
      • shouldEnableSelfPreservation

        boolean shouldEnableSelfPreservation()
        Checks 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 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.

        Returns:
        true to enable self preservation, false otherwise.
      • getRenewalPercentThreshold

        double getRenewalPercentThreshold()
        The minimum percentage of renewals that is expected from the clients in the period specified by getRenewalThresholdUpdateIntervalMs(). If the renewals drop below the threshold, the expirations are disabled if the shouldEnableSelfPreservation() is enabled.

        The changes are effective at runtime.

        Returns:
        value between 0 and 1 indicating the percentage. For example, 85% will be specified as 0.85.
      • getRenewalThresholdUpdateIntervalMs

        int getRenewalThresholdUpdateIntervalMs()
        The interval with which the threshold as specified in getRenewalPercentThreshold() needs to be updated.
        Returns:
        time in milliseconds indicating the interval.
      • getExpectedClientRenewalIntervalSeconds

        int getExpectedClientRenewalIntervalSeconds()
        The 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.
        Returns:
        time in seconds indicating the expected interval
      • getPeerEurekaNodesUpdateIntervalMs

        int getPeerEurekaNodesUpdateIntervalMs()
        The 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.

        Returns:
        timer in milliseconds indicating the interval.
      • shouldEnableReplicatedRequestCompression

        boolean shouldEnableReplicatedRequestCompression()
        If 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.
      • getNumberOfReplicationRetries

        int getNumberOfReplicationRetries()
        Get the number of times the replication events should be retried with peers.

        The changes are effective at runtime.

        Returns:
        the number of retries.
      • getPeerEurekaStatusRefreshTimeIntervalMs

        int getPeerEurekaStatusRefreshTimeIntervalMs()
        Gets the interval with which the status information about peer nodes is updated.

        The changes are effective at runtime.

        Returns:
        time in milliseconds indicating the interval.
      • getWaitTimeInMsWhenSyncEmpty

        int getWaitTimeInMsWhenSyncEmpty()
        Gets 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.
        Returns:
        time in milliseconds.
      • getPeerNodeConnectTimeoutMs

        int getPeerNodeConnectTimeoutMs()
        Gets the timeout value for connecting to peer eureka nodes for replication.
        Returns:
        timeout value in milliseconds.
      • getPeerNodeReadTimeoutMs

        int getPeerNodeReadTimeoutMs()
        Gets the timeout value for reading information from peer eureka nodes for replication.
        Returns:
        timeout value in milliseconds.
      • getPeerNodeTotalConnections

        int getPeerNodeTotalConnections()
        Gets the total number of HTTP connections allowed to peer eureka nodes for replication.
        Returns:
        total number of allowed HTTP connections.
      • getPeerNodeTotalConnectionsPerHost

        int getPeerNodeTotalConnectionsPerHost()
        Gets the total number of HTTP connections allowed to a particular peer eureka node for replication.
        Returns:
        total number of allowed HTTP connections for a peer node.
      • getPeerNodeConnectionIdleTimeoutSeconds

        int getPeerNodeConnectionIdleTimeoutSeconds()
        Gets the idle time after which the HTTP connection should be cleaned up.
        Returns:
        idle time in seconds.
      • getRetentionTimeInMSInDeltaQueue

        long getRetentionTimeInMSInDeltaQueue()
        Get the time for which the delta information should be cached for the clients to retrieve the value without missing it.
        Returns:
        time in milliseconds
      • getDeltaRetentionTimerIntervalInMs

        long getDeltaRetentionTimerIntervalInMs()
        Get the time interval with which the clean up task should wake up and check for expired delta information.
        Returns:
        time in milliseconds.
      • getEvictionIntervalTimerInMs

        long getEvictionIntervalTimerInMs()
        Get the time interval with which the task that expires instances should wake up and run.
        Returns:
        time in milliseconds.
      • shouldUseAwsAsgApi

        boolean shouldUseAwsAsgApi()
        Whether to use AWS API to query ASG statuses.
        Returns:
        true if AWS API is used, false otherwise.
      • getASGQueryTimeoutMs

        int getASGQueryTimeoutMs()
        Get the timeout value for querying the AWS for ASG information.
        Returns:
        timeout value in milliseconds.
      • getASGUpdateIntervalMs

        long getASGUpdateIntervalMs()
        Get the time interval with which the ASG information must be queried from AWS.
        Returns:
        time in milliseconds.
      • getASGCacheExpiryTimeoutMs

        long getASGCacheExpiryTimeoutMs()
        Get the expiration value for the cached ASG information
        Returns:
        time in milliseconds.
      • getResponseCacheAutoExpirationInSeconds

        long getResponseCacheAutoExpirationInSeconds()
        Gets the time for which the registry payload should be kept in the cache if it is not invalidated by change events.
        Returns:
        time in seconds.
      • getResponseCacheUpdateIntervalMs

        long getResponseCacheUpdateIntervalMs()
        Gets the time interval with which the payload cache of the client should be updated.
        Returns:
        time in milliseconds.
      • shouldUseReadOnlyResponseCache

        boolean shouldUseReadOnlyResponseCache()
        The ResponseCache currently uses a two level caching strategy to responses. A readWrite cache with an expiration policy, and a readonly cache that caches without expiry.
        Returns:
        true if the read only cache is to be used
      • shouldDisableDelta

        boolean shouldDisableDelta()
        Checks to see if the delta information can be served to client or not.

        The changes are effective at runtime.

        Returns:
        true if the delta information is allowed to be served, false otherwise.
      • getMaxIdleThreadInMinutesAgeForStatusReplication

        long getMaxIdleThreadInMinutesAgeForStatusReplication()
        Get the idle time for which the status replication threads can stay alive.
        Returns:
        time in minutes.
      • getMinThreadsForStatusReplication

        int getMinThreadsForStatusReplication()
        Get the minimum number of threads to be used for status replication.
        Returns:
        minimum number of threads to be used for status replication.
      • getMaxThreadsForStatusReplication

        int getMaxThreadsForStatusReplication()
        Get the maximum number of threads to be used for status replication.
        Returns:
        maximum number of threads to be used for status replication.
      • getMaxElementsInStatusReplicationPool

        int getMaxElementsInStatusReplicationPool()
        Get 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.

        Returns:
        the maximum number of replication events that can be allowed to back up.
      • shouldSyncWhenTimestampDiffers

        boolean shouldSyncWhenTimestampDiffers()
        Checks whether to synchronize instances when timestamp differs.

        The changes are effective at runtime.

        Returns:
        true, to synchronize, false otherwise.
      • getRegistrySyncRetries

        int getRegistrySyncRetries()
        Get the number of times that a eureka node would try to get the registry information from the peers during startup.
        Returns:
        the number of retries
      • getRegistrySyncRetryWaitMs

        long getRegistrySyncRetryWaitMs()
        Get the wait/sleep time between each retry sync attempts, if the prev retry failed and there are more retries to attempt.
        Returns:
        the wait time in ms between each sync retries
      • getMaxElementsInPeerReplicationPool

        int getMaxElementsInPeerReplicationPool()
        Get 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.

        Returns:
        the maximum number of replication events that can be allowed to back up.
      • getMaxIdleThreadAgeInMinutesForPeerReplication

        long getMaxIdleThreadAgeInMinutesForPeerReplication()
        Get the idle time for which the replication threads can stay alive.
        Returns:
        time in minutes.
      • getMinThreadsForPeerReplication

        int getMinThreadsForPeerReplication()
        Get the minimum number of threads to be used for replication.
        Returns:
        minimum number of threads to be used for replication.
      • getMaxThreadsForPeerReplication

        int getMaxThreadsForPeerReplication()
        Get the maximum number of threads to be used for replication.
        Returns:
        maximum number of threads to be used for replication.
      • getHealthStatusMinNumberOfAvailablePeers

        int getHealthStatusMinNumberOfAvailablePeers()
        Get 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.

        Returns:
        minimum number of available peer replication instances for this instance to be considered healthy.
      • getMaxTimeForReplication

        int getMaxTimeForReplication()
        Get the time in milliseconds to try to replicate before dropping replication events.
        Returns:
        time in milliseconds
      • shouldPrimeAwsReplicaConnections

        boolean shouldPrimeAwsReplicaConnections()
        Checks whether the connections to replicas should be primed. In AWS, the firewall requires sometime to establish network connection for new nodes.
        Returns:
        true, if connections should be primed, false otherwise.
      • shouldDisableDeltaForRemoteRegions

        boolean shouldDisableDeltaForRemoteRegions()
        Checks to see if the delta information can be served to client or not for remote regions.

        The changes are effective at runtime.

        Returns:
        true if the delta information is allowed to be served, false otherwise.
      • getRemoteRegionConnectTimeoutMs

        int getRemoteRegionConnectTimeoutMs()
        Gets the timeout value for connecting to peer eureka nodes for remote regions.
        Returns:
        timeout value in milliseconds.
      • getRemoteRegionReadTimeoutMs

        int getRemoteRegionReadTimeoutMs()
        Gets the timeout value for reading information from peer eureka nodes for remote regions.
        Returns:
        timeout value in milliseconds.
      • getRemoteRegionTotalConnections

        int getRemoteRegionTotalConnections()
        Gets the total number of HTTP connections allowed to peer eureka nodes for remote regions.
        Returns:
        total number of allowed HTTP connections.
      • getRemoteRegionTotalConnectionsPerHost

        int getRemoteRegionTotalConnectionsPerHost()
        Gets the total number of HTTP connections allowed to a particular peer eureka node for remote regions.
        Returns:
        total number of allowed HTTP connections for a peer node.
      • getRemoteRegionConnectionIdleTimeoutSeconds

        int getRemoteRegionConnectionIdleTimeoutSeconds()
        Gets the idle time after which the HTTP connection should be cleaned up for remote regions.
        Returns:
        idle time in seconds.
      • shouldGZipContentFromRemoteRegion

        boolean shouldGZipContentFromRemoteRegion()
        Indicates 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.
        Returns:
        true, if the content need to be compressed, false otherwise.
      • getRemoteRegionUrlsWithName

        java.util.Map<java.lang.String,​java.lang.String> getRemoteRegionUrlsWithName()
        Get a map of region name against remote region discovery url.
        Returns:
        - An unmodifiable map of remote region name against remote region discovery url. Empty map if no remote region url is defined.
      • getRemoteRegionUrls

        java.lang.String[] getRemoteRegionUrls()
        Get the list of remote region urls.
        Returns:
        - array of string representing URLs.
      • getRemoteRegionAppWhitelist

        @Nullable
        java.util.Set<java.lang.String> getRemoteRegionAppWhitelist​(@Nullable
                                                                    java.lang.String regionName)
        Returns a list of applications that must be retrieved from the passed remote region.
        This list can be null which 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 passing null to this method.
        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 null all applications must be retrieved.
      • getRemoteRegionRegistryFetchInterval

        int getRemoteRegionRegistryFetchInterval()
        Get the time interval for which the registry information need to be fetched from the remote region.
        Returns:
        time in seconds.
      • getRemoteRegionFetchThreadPoolSize

        int getRemoteRegionFetchThreadPoolSize()
        Size 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.
      • getRemoteRegionTrustStore

        java.lang.String getRemoteRegionTrustStore()
        Gets the fully qualified trust store file that will be used for remote region registry fetches.
        Returns:
      • getRemoteRegionTrustStorePassword

        java.lang.String getRemoteRegionTrustStorePassword()
        Get the remote region trust store's password.
      • disableTransparentFallbackToOtherRegion

        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.
        Returns:
        true if the old behavior is to be disabled.
      • shouldBatchReplication

        boolean shouldBatchReplication()
        Indicates whether the replication between cluster nodes should be batched for network efficiency.
        Returns:
        true if the replication needs to be batched.
      • getMyUrl

        java.lang.String getMyUrl()
        Allows 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, like http://eureka-node1.mydomain.com:8010/eureka/v2/
        Returns:
        URL Eureka will treat as its own
      • shouldLogIdentityHeaders

        boolean shouldLogIdentityHeaders()
        Indicates whether the eureka server should log/metric clientAuthHeaders
        Returns:
        true if the clientAuthHeaders should be logged and/or emitted as metrics
      • isRateLimiterEnabled

        boolean isRateLimiterEnabled()
        Indicates whether the rate limiter should be enabled or disabled.
      • isRateLimiterThrottleStandardClients

        boolean isRateLimiterThrottleStandardClients()
        Indicate if rate limit standard clients. If set to false, only non standard clients will be rate limited.
      • getRateLimiterPrivilegedClients

        java.util.Set<java.lang.String> getRateLimiterPrivilegedClients()
        A list of certified clients. This is in addition to standard eureka Java clients.
      • getRateLimiterRegistryFetchAverageRate

        int getRateLimiterRegistryFetchAverageRate()
        Rate limiter, token bucket algorithm property. Specifies the average enforced request rate. See also getRateLimiterBurstSize().
      • getRateLimiterFullFetchAverageRate

        int getRateLimiterFullFetchAverageRate()
        Rate limiter, token bucket algorithm property. Specifies the average enforced request rate. See also getRateLimiterBurstSize().
      • getListAutoScalingGroupsRoleName

        java.lang.String getListAutoScalingGroupsRoleName()
        Name of the Role used to describe auto scaling groups from third AWS accounts.
      • getJsonCodecName

        java.lang.String getJsonCodecName()
        Returns:
        the class name of the full json codec to use for the server. If none set a default codec will be used
      • getXmlCodecName

        java.lang.String getXmlCodecName()
        Returns:
        the class name of the full xml codec to use for the server. If none set a default codec will be used
      • getBindingStrategy

        AwsBindingStrategy getBindingStrategy()
        Get the configured binding strategy EIP or Route53.
        Returns:
        the configured binding strategy
      • getRoute53DomainTTL

        long getRoute53DomainTTL()
        Returns:
        the ttl used to set up the route53 domain if new
      • getRoute53BindRebindRetries

        int getRoute53BindRebindRetries()
        Gets the number of times the server should try to bind to the candidate Route53 domain.

        The changes are effective at runtime.

        Returns:
        the number of times the server should try to bind to the candidate Route53 domain.
      • getRoute53BindingRetryIntervalMs

        int getRoute53BindingRetryIntervalMs()
        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.

        The changes are effective at runtime.

        Returns:
        the time in milliseconds.
      • getExperimental

        java.lang.String getExperimental​(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.
        Returns:
        a property of experimental feature
      • getInitialCapacityOfResponseCache

        int getInitialCapacityOfResponseCache()
        Get the capacity of responseCache, default value is 1000.
        Returns:
        the capacity of responseCache.