Class EurekaConfig
- java.lang.Object
-
- org.kiwiproject.registry.eureka.config.EurekaConfig
-
- Direct Known Subclasses:
EurekaRegistrationConfig
public class EurekaConfig extends Object
Base configuration class for Eureka registry client configuration.
-
-
Constructor Summary
Constructors Constructor Description EurekaConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDomainOverride()Allows for adjustingregistryUrlsdomain at runtime.@NotBlank StringgetRegistryUrls()org.slf4j.event.LevelgetRetryExceptionLogLevel()The log level to use when logging HTTP call attempts that fail with an exception.StringgetRetryId()A unique ID that will be used when logging HTTP call attempts to Eureka.org.slf4j.event.LevelgetRetryProcessingLogLevel()The log level to use when logging HTTP call attempts.booleanisIncludeNativeData()If true, enables the addition of Eureka specific data to ServiceInstance.static StringretryId(Object identifier)Generates aretryIdby appending the String value ofidentifierto "EurekaRegistryClient-".voidsetDomainOverride(String domainOverride)Allows for adjustingregistryUrlsdomain at runtime.voidsetIncludeNativeData(boolean includeNativeData)If true, enables the addition of Eureka specific data to ServiceInstance.voidsetRegistryUrls(String urlCsv)Set the comma-separate list of Eureka server URLs.voidsetRegistryUrls(List<String> urls)Convenience method to set Eureka server URLS from a list of URLs rather than a CSV string.voidsetRetryExceptionLogLevel(org.slf4j.event.Level retryExceptionLogLevel)The log level to use when logging HTTP call attempts that fail with an exception.voidsetRetryId(String id)Sets the retry ID to"EurekaRegistryClient-" + id.voidsetRetryProcessingLogLevel(org.slf4j.event.Level retryProcessingLogLevel)The log level to use when logging HTTP call attempts.
-
-
-
Method Detail
-
getRegistryUrls
@NotBlank public @NotBlank String getRegistryUrls()
- Returns:
- comma separated list of urls pointing to Eureka servers, with domains replaced if
domainOverrideis set
-
setRegistryUrls
public void setRegistryUrls(String urlCsv)
Set the comma-separate list of Eureka server URLs.- Parameters:
urlCsv- a string containing the CSV string containing Eureka server URLs
-
setRegistryUrls
public void setRegistryUrls(List<String> urls)
Convenience method to set Eureka server URLS from a list of URLs rather than a CSV string.- Parameters:
urls- the list of URLs to set
-
setRetryId
public void setRetryId(String id)
Sets the retry ID to"EurekaRegistryClient-" + id.- Parameters:
id- a unique identifier- See Also:
retryId(Object)
-
retryId
public static String retryId(Object identifier)
Generates aretryIdby appending the String value ofidentifierto "EurekaRegistryClient-".- Parameters:
identifier- the unique identifier to use- Returns:
- a new retry identifier
- Implementation Note:
- if
identifieras a String starts with "EurekaRegistryClient-", that value returned as-is
-
getDomainOverride
public String getDomainOverride()
Allows for adjustingregistryUrlsdomain at runtime. This is useful if the urls are constant across services but a single service needs to access the server on a different domain due to networking restrictions
-
isIncludeNativeData
public boolean isIncludeNativeData()
If true, enables the addition of Eureka specific data to ServiceInstance.
-
getRetryId
public String getRetryId()
A unique ID that will be used when logging HTTP call attempts to Eureka.The default is "EurekaRegistryClient-" plus a unique integer, e.g. "EurekaRegistryClient-1", "EurekaRegistryClient-2", etc.
-
getRetryProcessingLogLevel
public org.slf4j.event.Level getRetryProcessingLogLevel()
The log level to use when logging HTTP call attempts. The default is DEBUG.
-
getRetryExceptionLogLevel
public org.slf4j.event.Level getRetryExceptionLogLevel()
The log level to use when logging HTTP call attempts that fail with an exception. The default is WARN.
-
setDomainOverride
public void setDomainOverride(String domainOverride)
Allows for adjustingregistryUrlsdomain at runtime. This is useful if the urls are constant across services but a single service needs to access the server on a different domain due to networking restrictions
-
setIncludeNativeData
public void setIncludeNativeData(boolean includeNativeData)
If true, enables the addition of Eureka specific data to ServiceInstance.
-
setRetryProcessingLogLevel
public void setRetryProcessingLogLevel(org.slf4j.event.Level retryProcessingLogLevel)
The log level to use when logging HTTP call attempts. The default is DEBUG.
-
setRetryExceptionLogLevel
public void setRetryExceptionLogLevel(org.slf4j.event.Level retryExceptionLogLevel)
The log level to use when logging HTTP call attempts that fail with an exception. The default is WARN.
-
-