Eureka Server Discovery Service

Eureka is a REST-based service that is primarily used for locating services for the purpose of load balancing and failover of middle-tier servers. Eureka provides both a discovery server and also support for clients which would be the individual CAS servers themselves in the pool. The server can be configured and deployed to be highly available, with each server replicating state about the registered services to the others.

CAS provides a Eureka-enabled service discovery integration that is based on Spring Cloud Netflix and bootstrapped via Spring Cloud.

Each individual CAS server is given the ability to auto-register itself with the discovery server, provided configuration is made available to instruct the CAS server how to locate and connect to the discover server service.

Support is added by including the following dependency in the WAR overlay:

1
2
3
4
5
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-eureka-client</artifactId>
    <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-eureka-client:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
    imports {
        mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
    }
}

dependencies {
    implementation "org.apereo.cas:cas-server-support-eureka-client"
}
1
2
3
4
5
6
7
8
9
10
dependencies {
    /*
        The following platform references are included automatically and are listed for reference only.

        implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
        implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
        
    */
    implementation "org.apereo.cas:cas-server-support-eureka-client"
}

The following settings and properties are available from the CAS configuration catalog:

eureka.client.allow-redirectsIndicates whether server can redirect a client request to a backup server/cluster.
false
Third party

Indicates whether server can redirect a client request to a backup server/cluster. If set to false, the server will handle the request directly, If set to true, it may send HTTP redirect to the client, with a new server location.

Type
Boolean
Default
false
Defined by
EurekaClientConfigBean
eureka.client.availability-zonesGets the list of availability zones (used in AWS data centers) for the region in which this instance resides.
no default
Third party

Gets the list of availability zones (used in AWS data centers) for the region in which this instance resides. The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds.

Type
Map<String,String>
Default
none
Defined by
EurekaClientConfigBean
eureka.client.backup-registry-implGets the name of the implementation which implements BackupRegistry to fetch the registry information as a fallback option for only the first time when the eureka client starts.
no default
Third party

Gets the name of the implementation which implements BackupRegistry to fetch the registry information as a fallback option for only the first time when the eureka client starts. This may be needed for applications which needs additional resiliency for registry information without which it cannot operate.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.cache-refresh-executor-exponential-back-off-boundCache refresh executor exponential back off related property.
10
Third party

Cache refresh executor exponential back off related property. It is a maximum multiplier value for retry delay, in case where a sequence of timeouts occurred.

Type
Integer
Default
10
Defined by
EurekaClientConfigBean
eureka.client.cache-refresh-executor-thread-pool-sizeThe thread pool size for the cacheRefreshExecutor to initialise with.
2
Third party

The thread pool size for the cacheRefreshExecutor to initialise with.

Type
Integer
Default
2
Defined by
EurekaClientConfigBean
eureka.client.client-data-acceptEurekaAccept name for client data accept.
no default
Third party

EurekaAccept name for client data accept.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.decoder-nameThis is a transient config and once the latest codecs are stable, can be removed (as there will only be one).
no default
Third party

This is a transient config and once the latest codecs are stable, can be removed (as there will only be one).

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.disable-deltaIndicates whether the eureka client should disable fetching of delta and should rather resort to getting the full registry information.
false
Third party

Indicates whether the eureka client should disable fetching of delta and should rather resort to getting the full registry information. Note that the delta fetches can reduce the traffic tremendously, because the rate of change with the eureka server is normally much lower than the rate of fetches. The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds

Type
Boolean
Default
false
Defined by
EurekaClientConfigBean
eureka.client.dollar-replacementGet a replacement string for Dollar sign $ during serializing/deserializing information in eureka server.
_-
Third party

Get a replacement string for Dollar sign $ during serializing/deserializing information in eureka server.

Type
String
Default
_-
Defined by
EurekaClientConfigBean
eureka.client.enabledFlag to indicate that the Eureka client is enabled.
true
Third party

Flag to indicate that the Eureka client is enabled.

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.encoder-nameThis is a transient config and once the latest codecs are stable, can be removed (as there will only be one).
no default
Third party

This is a transient config and once the latest codecs are stable, can be removed (as there will only be one).

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.escape-char-replacementGet a replacement string for underscore sign _ during serializing/ deserializing information in eureka server.
__
Third party

Get a replacement string for underscore sign _ during serializing/ deserializing information in eureka server.

Type
String
Default
__
Defined by
EurekaClientConfigBean
eureka.client.eureka-connection-idle-timeout-secondsIndicates how much time (in seconds) that the HTTP connections to eureka server can stay idle before it can be closed.
30
Third party

Indicates how much time (in seconds) that the HTTP connections to eureka server can stay idle before it can be closed. In the AWS environment, it is recommended that the values is 30 seconds or less, since the firewall cleans up the connection information after a few mins leaving the connection hanging in limbo.

Type
Integer
Default
30
Defined by
EurekaClientConfigBean
eureka.client.eureka-server-connect-timeout-secondsIndicates how long to wait (in seconds) before a connection to eureka server needs to timeout.
5
Third party

Indicates how long to wait (in seconds) before a connection to eureka server needs to timeout. Note that the connections in the client are pooled by HttpClient and this setting affects the actual connection creation and also the wait time to get the connection from the pool.

Type
Integer
Default
5
Defined by
EurekaClientConfigBean
eureka.client.eureka-server-d-n-s-nameGets the DNS name to be queried to get the list of eureka servers.This information is not required if the contract returns the service urls by implementing serviceUrls.
no default
Third party

Gets the DNS name to be queried to get the list of eureka servers.This information is not required if the contract returns the service urls by implementing serviceUrls. The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.eureka-server-portGets the port to be used to construct the service url to contact eureka server when the list of eureka servers come from the DNS.This information is not required if the contract returns the service urls eurekaServerSe...
no default
Third party

Gets the port to be used to construct the service url to contact eureka server when the list of eureka servers come from the DNS.This information is not required if the contract returns the service urls eurekaServerServiceUrls(String). The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.eureka-server-read-timeout-secondsIndicates how long to wait (in seconds) before a read from eureka server needs to timeout.
8
Third party

Indicates how long to wait (in seconds) before a read from eureka server needs to timeout.

Type
Integer
Default
8
Defined by
EurekaClientConfigBean
eureka.client.eureka-server-total-connectionsGets the total number of connections that is allowed from eureka client to all eureka servers.
200
Third party

Gets the total number of connections that is allowed from eureka client to all eureka servers.

Type
Integer
Default
200
Defined by
EurekaClientConfigBean
eureka.client.eureka-server-total-connections-per-hostGets the total number of connections that is allowed from eureka client to a eureka server host.
50
Third party

Gets the total number of connections that is allowed from eureka client to a eureka server host.

Type
Integer
Default
50
Defined by
EurekaClientConfigBean
eureka.client.eureka-server-u-r-l-contextGets the URL context to be used to construct the service url to contact eureka server when the list of eureka servers come from the DNS.
no default
Third party

Gets the URL context to be used to construct the service url to contact eureka server when the list of eureka servers come from the DNS. This information is not required if the contract returns the service urls from eurekaServerServiceUrls. The DNS mechanism is used when useDnsForFetchingServiceUrls is set to true and the eureka client expects the DNS to configured a certain way so that it can fetch changing eureka servers dynamically. The changes are effective at runtime.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.eureka-service-url-poll-interval-secondsIndicates how often(in seconds) to poll for changes to eureka server information.
300
Third party

Indicates how often(in seconds) to poll for changes to eureka server information. Eureka servers could be added or removed and this setting controls how soon the eureka clients should know about it.

Type
Integer
Default
300
Defined by
EurekaClientConfigBean
eureka.client.fetch-registryIndicates whether this client should fetch eureka registry information from eureka server.
true
Third party

Indicates whether this client should fetch eureka registry information from eureka server.

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.fetch-remote-regions-registryComma separated list of regions for which the eureka registry information will be fetched.
no default
Third party

Comma separated list of regions for which the eureka registry information will be fetched. It is mandatory to define the availability zones for each of these regions as returned by availabilityZones. Failing to do so, will result in failure of discovery client startup.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.filter-only-up-instancesIndicates whether to get the applications after filtering the applications for instances with only InstanceStatus UP states.
true
Third party

Indicates whether to get the applications after filtering the applications for instances with only InstanceStatus UP states.

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.g-zip-contentIndicates whether the content fetched from eureka server has to be compressed whenever it is supported by the server.
true
Third party

Indicates whether the content fetched from eureka server has to be compressed whenever it is supported by the server. The registry information from the eureka server is compressed for optimum network traffic.

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.healthcheck.enabledEnables the Eureka health check handler.
true
Third party

Enables the Eureka health check handler.

Type
Boolean
Default
true
eureka.client.heartbeat-executor-exponential-back-off-boundHeartbeat executor exponential back off related property.
10
Third party

Heartbeat executor exponential back off related property. It is a maximum multiplier value for retry delay, in case where a sequence of timeouts occurred.

Type
Integer
Default
10
Defined by
EurekaClientConfigBean
eureka.client.heartbeat-executor-thread-pool-sizeThe thread pool size for the heartbeatExecutor to initialise with.
2
Third party

The thread pool size for the heartbeatExecutor to initialise with.

Type
Integer
Default
2
Defined by
EurekaClientConfigBean
eureka.client.initial-instance-info-replication-interval-secondsIndicates how long initially (in seconds) to replicate instance info to the eureka server.
40
Third party

Indicates how long initially (in seconds) to replicate instance info to the eureka server.

Type
Integer
Default
40
Defined by
EurekaClientConfigBean
eureka.client.instance-info-replication-interval-secondsIndicates how often(in seconds) to replicate instance changes to be replicated to the eureka server.
30
Third party

Indicates how often(in seconds) to replicate instance changes to be replicated to the eureka server.

Type
Integer
Default
30
Defined by
EurekaClientConfigBean
eureka.client.jersey.enabledEnables the use of JerseyClient for Eureka HTTP Client.
true
Third party

Enables the use of JerseyClient for Eureka HTTP Client.

Type
Boolean
Default
true
eureka.client.log-delta-diffIndicates whether to log differences between the eureka server and the eureka client in terms of registry information.
false
Third party

Indicates whether to log differences between the eureka server and the eureka client in terms of registry information. Eureka client tries to retrieve only delta changes from eureka server to minimize network traffic. After receiving the deltas, eureka client reconciles the information from the server to verify it has not missed out some information. Reconciliation failures could happen when the client has had network issues communicating to server.If the reconciliation fails, eureka client gets the full registry information. While getting the full registry information, the eureka client can log the differences between the client and the server and this setting controls that. The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSecondsr

Type
Boolean
Default
false
Defined by
EurekaClientConfigBean
eureka.client.on-demand-update-status-changeIf set to true, local status updates via ApplicationInfoManager will trigger on-demand (but rate limited) register/updates to remote eureka servers.
true
Third party

If set to true, local status updates via ApplicationInfoManager will trigger on-demand (but rate limited) register/updates to remote eureka servers.

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.orderOrder of the discovery client used by `CompositeDiscoveryClient` for sorting available clients.
0
Third party

Order of the discovery client used by `CompositeDiscoveryClient` for sorting available clients.

Type
Integer
Default
0
Defined by
EurekaClientConfigBean
eureka.client.prefer-same-zone-eurekaIndicates whether or not this instance should try to use the eureka server in the same zone for latency and/or other reason.
true
Third party

Indicates whether or not this instance should try to use the eureka server in the same zone for latency and/or other reason. Ideally eureka clients are configured to talk to servers in the same zone The changes are effective at runtime at the next registry fetch cycle as specified by registryFetchIntervalSeconds

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.property-resolver
no default
Third party
Type
PropertyResolver
Default
none
Defined by
EurekaClientConfigBean
eureka.client.proxy-hostGets the proxy host to eureka server if any.
no default
Third party

Gets the proxy host to eureka server if any.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.proxy-passwordGets the proxy password if any.
no default
Third party

Gets the proxy password if any.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.proxy-portGets the proxy port to eureka server if any.
no default
Third party

Gets the proxy port to eureka server if any.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.proxy-user-nameGets the proxy user name if any.
no default
Third party

Gets the proxy user name if any.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.refresh.enableDetermines whether the EurekaClient instance can be refreshed or not(If disabled none of the Eureka client properties will be refreshable).
true
Third party

Determines whether the EurekaClient instance can be refreshed or not(If disabled none of the Eureka client properties will be refreshable).

Type
Boolean
Default
true
eureka.client.regionGets the region (used in AWS datacenters) where this instance resides.
us-east-1
Third party

Gets the region (used in AWS datacenters) where this instance resides.

Type
String
Default
us-east-1
Defined by
EurekaClientConfigBean
eureka.client.register-with-eurekaIndicates whether or not this instance should register its information with eureka server for discovery by others.
true
Third party

Indicates whether or not this instance should register its information with eureka server for discovery by others. In some cases, you do not want your instances to be discovered whereas you just want do discover other instances.

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.registry-fetch-interval-secondsIndicates how often(in seconds) to fetch the registry information from the eureka server.
30
Third party

Indicates how often(in seconds) to fetch the registry information from the eureka server.

Type
Integer
Default
30
Defined by
EurekaClientConfigBean
eureka.client.registry-refresh-single-vip-addressIndicates whether the client is only interested in the registry information for a single VIP.
no default
Third party

Indicates whether the client is only interested in the registry information for a single VIP.

Type
String
Default
none
Defined by
EurekaClientConfigBean
eureka.client.service-urlMap of availability zone to list of fully qualified URLs to communicate with eureka server.
no default
Third party

Map of availability zone to list of fully qualified URLs to communicate with eureka server. Each value can be a single URL or a comma separated list of alternative locations. Typically the eureka server URLs carry protocol,host,port,context and version information if any. Example: https://ec2-256-156-243-129.compute-1.amazonaws.com:7001/eureka/ The changes are effective at runtime at the next service url refresh cycle as specified by eurekaServiceUrlPollIntervalSeconds.

Type
Map<String,String>
Default
none
Defined by
EurekaClientConfigBean
eureka.client.should-enforce-registration-at-initIndicates whether the client should enforce registration during initialization.
false
Third party

Indicates whether the client should enforce registration during initialization. Defaults to false.

Type
Boolean
Default
false
Defined by
EurekaClientConfigBean
eureka.client.should-unregister-on-shutdownIndicates whether the client should explicitly unregister itself from the remote server on client shutdown.
true
Third party

Indicates whether the client should explicitly unregister itself from the remote server on client shutdown.

Type
Boolean
Default
true
Defined by
EurekaClientConfigBean
eureka.client.timeout.connect-request-timeout
180000
Third party
Type
Integer
Default
180000
Defined by
TimeoutProperties
eureka.client.timeout.connect-timeoutDefault values are set to 180000, in keeping with RequestConfig and SocketConfig defaults.
180000
Third party

Default values are set to 180000, in keeping with RequestConfig and SocketConfig defaults.

Type
Integer
Default
180000
Defined by
TimeoutProperties
eureka.client.timeout.socket-timeout
180000
Third party
Type
Integer
Default
180000
Defined by
TimeoutProperties
eureka.client.tls.enabled
no default
Third party
Type
Boolean
Default
none
Defined by
TlsProperties
eureka.client.tls.key-password
no default
Third party
Type
String
Default
none
Defined by
TlsProperties
eureka.client.tls.key-store
no default
Third party
Type
Resource
Default
none
Defined by
TlsProperties
eureka.client.tls.key-store-password
no default
Third party
Type
String
Default
none
Defined by
TlsProperties
eureka.client.tls.key-store-type
no default
Third party
Type
String
Default
none
Defined by
TlsProperties
eureka.client.tls.trust-store
no default
Third party
Type
Resource
Default
none
Defined by
TlsProperties
eureka.client.tls.trust-store-password
no default
Third party
Type
String
Default
none
Defined by
TlsProperties
eureka.client.tls.trust-store-type
no default
Third party
Type
String
Default
none
Defined by
TlsProperties
eureka.client.use-dns-for-fetching-service-urlsIndicates whether the eureka client should use the DNS mechanism to fetch a list of eureka servers to talk to.
false
Third party

Indicates whether the eureka client should use the DNS mechanism to fetch a list of eureka servers to talk to. When the DNS name is updated to have additional servers, that information is used immediately after the eureka client polls for that information as specified in eurekaServiceUrlPollIntervalSeconds. Alternatively, the service urls can be returned serviceUrls, but the users should implement their own mechanism to return the updated list in case of changes. The changes are effective at runtime.

Type
Boolean
Default
false
Defined by
EurekaClientConfigBean
eureka.client.webclient.enabledEnables the use of WebClient for Eureka HTTP Client.
false
Third party

Enables the use of WebClient for Eureka HTTP Client.

Type
Boolean
Default
false
spring.cloud.config.discovery.enabledFlag to indicate that config server discovery is enabled (config server URL will be looked up via discovery).
false
Third party

Flag to indicate that config server discovery is enabled (config server URL will be looked up via discovery).

Type
Boolean
Default
false
Defined by
ConfigClientProperties$Discovery
spring.cloud.config.discovery.service-idService id to locate config server.
configserver
Third party

Service id to locate config server.

Type
String
Default
configserver
Defined by
ConfigClientProperties$Discovery

Required settings may be needed to activate or affect the feature; review them even when they have a default. Optional settings only need to be set to change a default or to turn on the behavior they control. Third party settings belong to libraries such as Spring Boot that CAS builds on; their own documentation may have more detail.

Notes on configuration

Configuration Metadata

The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.

Be Selective

This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.

YAGNI

Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.

Naming Convention

Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc.

:information_source: Note

When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value. The only possible exception to this rule is when naming actuator endpoints; The name of the actuator endpoints (i.e. ssoSessions) MUST remain in camelCase mode.

Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.

Validation

Configuration properties are automatically validated on CAS startup to report issues with configuration binding, especially if defined CAS settings cannot be recognized or validated by the configuration schema. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.

Indexed Settings

CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.

Authentication

Support for HTTP basic authentication will be automatically added if one of Eureka server URLs in the configuration has credentials embedded in it (curl style, like http://user:password@localhost:8761/eureka).

Troubleshooting

To enable additional logging, configure the log4j configuration file to add the following levels:

1
2
3
4
5
6
7
8
<Logger name="org.springframework.cloud" level="debug" additivity="false">
  <AppenderRef ref="casConsole"/>
  <AppenderRef ref="casFile"/>
</Logger>
<Logger name="com.netflix" level="debug" additivity="false">
    <AppenderRef ref="casConsole"/>
    <AppenderRef ref="casFile"/>
</Logger>

Actuator Endpoints

The following endpoints are provided by CAS:

clusterTopology
CAS endpoint2 operationsNot exposed by default
1

Turn the endpoint on and expose it over the web. One entry covers every operation. By default only info, health and status are exposed.

1
2
management.endpoint.clusterTopology.access=UNRESTRICTED
management.endpoints.web.exposure.include=clusterTopology

Endpoints may be mapped to other paths. For example, to serve health at healthcheck:

1
management.endpoints.web.path-mapping.health=healthcheck