Class EurekaInstanceConfig
public class EurekaInstanceConfig : IEurekaInstanceConfig
- Inheritance
-
EurekaInstanceConfig
- Implements
- Derived
- Inherited Members
Constructors
EurekaInstanceConfig()
public EurekaInstanceConfig()
Fields
Default_Appname
public const string Default_Appname = "unknown"
Field Value
Default_HealthCheckUrlPath
public const string Default_HealthCheckUrlPath = "/healthcheck"
Field Value
Default_HomePageUrlPath
public const string Default_HomePageUrlPath = "/"
Field Value
Default_LeaseExpirationDurationInSeconds
public const int Default_LeaseExpirationDurationInSeconds = 90
Field Value
Default_LeaseRenewalIntervalInSeconds
public const int Default_LeaseRenewalIntervalInSeconds = 30
Field Value
Default_NonSecurePort
public const int Default_NonSecurePort = 80
Field Value
Default_SecurePort
public const int Default_SecurePort = 443
Field Value
Default_StatusPageUrlPath
public const string Default_StatusPageUrlPath = "/Status"
Field Value
_thisHostAddress
protected string _thisHostAddress
Field Value
_thisHostName
protected string _thisHostName
Field Value
Properties
ASGName
Gets or sets the
AWS autoscaling group name
associated with this instance. This information is
specifically used in an AWS environment to automatically put an instance out of service after the instance is
launched and it has been disabled for traffic..
Configuration property: eureka:instance:asgName
public virtual string ASGName { get; set; }
Property Value
AppGroupName
Gets or sets the name of the application group to be registered with eureka. Configuration property: eureka:instance:appGroup
public virtual string AppGroupName { get; set; }
Property Value
AppName
Gets or sets the name of the application to be registered with eureka. Configuration property: eureka:instance:name
public virtual string AppName { get; set; }
Property Value
DataCenterInfo
Gets or sets the data center this instance is deployed. This information is used to get some AWS specific instance information if the instance is deployed in AWS.
public virtual IDataCenterInfo DataCenterInfo { get; set; }
Property Value
DefaultAddressResolutionOrder
Gets or sets an instance's network addresses should be fully expressed in it's DataCenterInfo For example for instances in AWS, this will include the publicHostname, publicIp, privateHostname and privateIp, when available. The InstanceInfo will further express a "default address", which is a field that can be configured by the registering instance to advertise it's default address. This configuration allowed for the expression of an ordered list of fields that can be used to resolve the default address. The exact field values will depend on the implementation details of the corresponding implementing DataCenterInfo types.
public virtual IEnumerable<string> DefaultAddressResolutionOrder { get; set; }
Property Value
HealthCheckUrl
Gets or sets gets the absolute health check page URL for this instance. The users can provide the path if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.
It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to/ proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. Configuration property: eureka:instance:healthCheckUrl
public virtual string HealthCheckUrl { get; set; }
Property Value
HealthCheckUrlPath
Gets or sets gets the relative health check URL Path for this instance. The health check page URL is then constructed out of the GetHostName(bool) and the type of communication - secure or unsecure as specified in SecurePort and NonSecurePort
It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to proceed deployments to an entire farm or stop the deployments without causing further damage. Configuration property: eureka:instance:healthCheckUrlPath
public virtual string HealthCheckUrlPath { get; set; }
Property Value
HomePageUrl
Gets or sets gets the absolute home page URL for this instance. The users can provide the path if the home page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.
It is normally used for informational purposes for other services tofind about the status of this instance. Users can provide a simple
HTML
indicating what is the current status of the instance.
The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is
replaced at runtime.
Configuration property: eureka:instance:homePageUrl
public virtual string HomePageUrl { get; set; }
Property Value
HomePageUrlPath
Gets or sets gets the relative home page URL Path for this instance. The home page URL is then constructed out of the GetHostName(bool) and the type of communication - secure or unsecure as specified in SecurePort and NonSecurePort
It is normally used for informational purposes for other services to use it as a landing page. Configuration property: eureka:instance:homePageUrlPath
public virtual string HomePageUrlPath { get; set; }
Property Value
HostName
public virtual string HostName { get; set; }
Property Value
InstanceId
Gets or sets the unique Id (within the scope of the appName) of this instance to be registered with eureka. Configuration property: eureka:instance:instanceId
public virtual string InstanceId { get; set; }
Property Value
IpAddress
Gets or sets the IPAdress of the instance. This information is for academic purposes only as the communication from other instances primarily happen using the information supplied in GetHostName(bool)
public virtual string IpAddress { get; set; }
Property Value
IsInstanceEnabledOnInit
Gets or sets a value indicating whether indicates whether the instance should be enabled for taking traffic as soon as it is registered with eureka. Sometimes the application might need to do some pre-processing before it is ready to take traffic. Configuration property: eureka:instance:instanceEnabledOnInit
public virtual bool IsInstanceEnabledOnInit { get; set; }
Property Value
IsNonSecurePortEnabled
Gets or sets a value indicating whether indicates whether the
non-secure
port should be enabled for traffic or not.
Set true if the non-secure
port is enabled, false otherwise.
Configuration property: eureka:instance:nonSecurePortEnabled
public virtual bool IsNonSecurePortEnabled { get; set; }
Property Value
LeaseExpirationDurationInSeconds
Gets or sets indicates the time in seconds that the eureka server waits since it received the last heartbeat before it can remove this instance from its view and there by disallowing traffic to this instance.
Setting this value too long could mean that the traffic could be routed to the instance even though the instance is not alive. Setting this value too small could mean, the instance may be taken out of traffic because of temporary network glitches.This value to be set to atleast higher than the value specified in LeaseRenewalIntervalInSeconds Configuration property: eureka:instance:leaseExpirationDurationInSeconds
public virtual int LeaseExpirationDurationInSeconds { get; set; }
Property Value
LeaseRenewalIntervalInSeconds
Gets or sets indicates how often (in seconds) the eureka client needs to send heartbeats to eureka server to indicate that it is still alive. If the heartbeats are not received for the period specified in LeaseExpirationDurationInSeconds, eureka server will removethe instance from its view, there by disallowing traffic to this instance. Note that the instance could still not take traffic if it implements HealthCheckCallback and then decides to make itself unavailable. Configuration property: eureka:instance:leaseRenewalIntervalInSeconds
public virtual int LeaseRenewalIntervalInSeconds { get; set; }
Property Value
MetadataMap
Gets or sets the metadata name/value pairs associated with this instance. This information is sent to eureka server and can be used by other instances. Configuration property: eureka:instance:metadataMap
public virtual IDictionary<string, string> MetadataMap { get; set; }
Property Value
NetUtils
public InetUtils NetUtils { get; set; }
Property Value
NonSecurePort
Gets or sets the
non-secure
port on which the instance should receive traffic.
Configuration property: eureka:instance:port
public virtual int NonSecurePort { get; set; }
Property Value
PreferIpAddress
public virtual bool PreferIpAddress { get; set; }
Property Value
SecureHealthCheckUrl
Gets or sets gets the absolute secure health check page URL for this instance. The users can provide the path if the health check page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.
It is normally used for making educated decisions based on the health of the instance - for example, it can be used to determine whether to/ proceed deployments to an entire farm or stop the deployments without causing further damage. The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is replaced at runtime. Configuration property: eureka:instance:secureHealthCheckUrl
public virtual string SecureHealthCheckUrl { get; set; }
Property Value
SecurePort
Gets or sets the
Secure port
on which the instance should receive traffic.
Configuration property: eureka:instance:securePort
public virtual int SecurePort { get; set; }
Property Value
SecurePortEnabled
Gets or sets a value indicating whether indicates whether the
secure
port should be enabled for traffic or not.
Set true if the secure
port is enabled, false otherwise.
Configuration property: eureka:instance:securePortEnabled
public virtual bool SecurePortEnabled { get; set; }
Property Value
SecureVirtualHostName
Gets or sets the secure virtual host name defined for this instance.
This is typically the way other instance would find this instance by using the virtual host name. Think of this as similar to the fully qualified domain name, that the users of your services will need to find this instance. Configuration property: eureka:instance:secureVipAddress
public virtual string SecureVirtualHostName { get; set; }
Property Value
StatusPageUrl
Gets or sets the absolute status page for this instance. The users can provide the StatusPageUrlPath if the status page resides in the same instance talking to eureka, else in the cases where the instance is a proxy for some other server, users can provide the full URL. If the full URL is provided it takes precedence.
It is normally used for informational purposes for other services tofind about the status of this instance. Users can provide a simple
HTML
indicating what is the current status of the instance.
The full URL should follow the format http://${eureka.hostname}:7001/ where the value ${eureka.hostname} is
replaced at runtime.
Configuration property: eureka:instance:statusPageUrl
public virtual string StatusPageUrl { get; set; }
Property Value
StatusPageUrlPath
Gets or sets the relative status page Path for this instance. The status page URL is then constructed out of the GetHostName(bool) and the type of communication - secure or unsecure as specified in SecurePort and NonSecurePort.
It is normally used for informational purposes for other services to findabout the status of this instance. Users can provide a simple
HTML
indicating what is the current status of the instance.
Configuration property: eureka:instance:statusPageUrlPath
public virtual string StatusPageUrlPath { get; set; }
Property Value
UseNetUtils
public bool UseNetUtils { get; set; }
Property Value
VirtualHostName
Gets or sets the virtual host name defined for this instance.
This is typically the way other instance would find this instance by using the virtual host name. Think of this as similar to the fully qualified domain name, that the users of your services will need to find this instance. Configuration property: eureka:instance:vipAddress
public virtual string VirtualHostName { get; set; }
Property Value
Methods
ApplyNetUtils()
public void ApplyNetUtils()
GetHostName(bool)
Gets the hostname associated with this instance. This is the exact name that would be used by other instances to make calls.
public virtual string GetHostName(bool refresh)
Parameters
refresh
boolrefresh hostname
Returns
- string
hostname