Table of Contents

Class ConsulDiscoveryOptions

Namespace
Steeltoe.Discovery.Consul.Discovery
Assembly
Steeltoe.Discovery.Consul.dll

Configuration options for the ConsulDiscoveryClient

public class ConsulDiscoveryOptions
Inheritance
ConsulDiscoveryOptions
Inherited Members

Constructors

ConsulDiscoveryOptions()

public ConsulDiscoveryOptions()

Fields

CONSUL_DISCOVERY_CONFIGURATION_PREFIX

public const string CONSUL_DISCOVERY_CONFIGURATION_PREFIX = "consul:discovery"

Field Value

string

Properties

CacheTTL

Gets or sets the time in seconds that service instance cache records should remain active

public int CacheTTL { get; set; }

Property Value

int

DefaultQueryTag

Gets or sets Tag to query for in service list if one is not listed in serverListQueryTags.

public string DefaultQueryTag { get; set; }

Property Value

string

DefaultZoneMetadataName

Gets or sets the metadata tag name of the zone

public string DefaultZoneMetadataName { get; set; }

Property Value

string

Deregister

Gets or sets a value indicating whether gets or sets Deregister automatic de-registration of service in consul.

public bool Deregister { get; set; }

Property Value

bool

Enabled

Gets or sets a value indicating whether Consul Discovery client is enabled

public bool Enabled { get; set; }

Property Value

bool

FailFast

Gets or sets a value indicating whether gets or sets FailFast Throw exceptions during service registration if true, otherwise, log warnings(defaults to true).

public bool FailFast { get; set; }

Property Value

bool

HealthCheckCriticalTimeout

Gets or sets Timeout to deregister services critical for longer than timeout(e.g. 30m). Requires consul version 7.x or higher.

public string HealthCheckCriticalTimeout { get; set; }

Property Value

string

HealthCheckInterval

Gets or sets How often to perform the health check (e.g. 10s), defaults to 10s.

public string HealthCheckInterval { get; set; }

Property Value

string

HealthCheckPath

Gets or sets Alternate server path to invoke for health checking

public string HealthCheckPath { get; set; }

Property Value

string

HealthCheckTimeout

Gets or sets Timeout for health check (e.g. 10s).

public string HealthCheckTimeout { get; set; }

Property Value

string

HealthCheckTlsSkipVerify

Gets or sets a value indicating whether health check verifies TLS

public bool HealthCheckTlsSkipVerify { get; set; }

Property Value

bool

HealthCheckUrl

Gets or sets Custom health check url to override default

public string HealthCheckUrl { get; set; }

Property Value

string

Heartbeat

Gets or sets values related to Heartbeat

public ConsulHeartbeatOptions Heartbeat { get; set; }

Property Value

ConsulHeartbeatOptions

HostName

Gets or sets Hostname to use when accessing server

public string HostName { get; set; }

Property Value

string

InstanceGroup

Gets or sets the instance groupt to use during registration

public string InstanceGroup { get; set; }

Property Value

string

InstanceId

Gets or sets Unique service instance id

public string InstanceId { get; set; }

Property Value

string

InstanceZone

Gets or sets the instance zone to use during registration

public string InstanceZone { get; set; }

Property Value

string

IpAddress

Gets or sets IP address to use when accessing service (must also set preferIpAddress to use)

public string IpAddress { get; set; }

Property Value

string

IsHeartBeatEnabled

Gets a value indicating whether heart beat is enabled

public bool IsHeartBeatEnabled { get; }

Property Value

bool

IsRetryEnabled

Gets a value indicating whether retry is enabled

public bool IsRetryEnabled { get; }

Property Value

bool

Metadata

Gets or sets Metadata to use when registering service

public IDictionary<string, string> Metadata { get; set; }

Property Value

IDictionary<string, string>

NetUtils

public InetUtils NetUtils { get; set; }

Property Value

InetUtils

Port

Gets or sets Port to register the service under

public int Port { get; set; }

Property Value

int

PreferAgentAddress

Gets or sets a value indicating whether to use agent address or hostname

public bool PreferAgentAddress { get; set; }

Property Value

bool

PreferIpAddress

Gets or sets a value indicating whether gets or sets Use ip address rather than hostname during registration

public bool PreferIpAddress { get; set; }

Property Value

bool

QueryPassing

Gets or sets a value indicating whether gets or sets Add the 'passing` parameter to /v1/health/service/serviceName. This pushes health check passing to the server.

public bool QueryPassing { get; set; }

Property Value

bool

Register

Gets or sets a value indicating whether gets or sets Register as a service in consul.

public bool Register { get; set; }

Property Value

bool

RegisterHealthCheck

Gets or sets a value indicating whether gets or sets RegisterHealthCheck in consul. Useful during development of a service.

public bool RegisterHealthCheck { get; set; }

Property Value

bool

Retry

Gets or sets values related to Retrying requests

public ConsulRetryOptions Retry { get; set; }

Property Value

ConsulRetryOptions

Scheme

Gets or sets Whether to register an http or https service

public string Scheme { get; set; }

Property Value

string

ServiceName

Gets or sets Service name

public string ServiceName { get; set; }

Property Value

string

Tags

Gets or sets Tags to use when registering service

public IList<string> Tags { get; set; }

Property Value

IList<string>

TagsAsMetadata

Gets or sets a value indicating whether use tags as metadata, defaults to true

public bool TagsAsMetadata { get; set; }

Property Value

bool

UseAspNetCoreUrls

Gets or sets a value indicating whether to register a Url from ASP.NET Core configuration

public bool UseAspNetCoreUrls { get; set; }

Property Value

bool

UseNetUtils

public bool UseNetUtils { get; set; }

Property Value

bool

Methods

ApplyConfigUrls(List<Uri>, string)

Set properties from addresses found in configuration

public void ApplyConfigUrls(List<Uri> addresses, string wildcard_hostname)

Parameters

addresses List<Uri>

A list of addresses the application is listening on

wildcard_hostname string

String representation of a wildcard hostname

ApplyNetUtils()

public void ApplyNetUtils()