Class HTTPRetry
Describes the retry policy to use when a HTTP request fails. For example, the following rule sets the maximum number of retries to 3 when calling ratings:v1 service, with a 2s timeout per retry attempt.
Namespace: Neon.Kube.Resources.Istio
Assembly: Neon.Kube.Resources.dll
Syntax
public class HTTPRetry
Constructors
HTTPRetry()
Initializes a new instance of the HTTPRetry class.
Declaration
public HTTPRetry()
Properties
Attempts
> Number of retries to be allowed for a given request. The interval between retries will be determined automatically (25ms+). When request timeout of the HTTP route or per_try_timeout is configured, the actual number of retries attempted also depends on the specified request timeout and per_try_timeout values.
Declaration
[JsonProperty(PropertyName = "attempts", Required = Required.Always, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public int? Attempts { get; set; }
Property Value
Type | Description |
---|---|
int? |
PerTryTimeout
Timeout per attempt for a given request, including the initial call and any retries. Format: 1h/1m/1s/1ms. MUST BE >=1ms. Default is same value as request timeout of the HTTP route, which means no timeout.
Declaration
[JsonProperty(PropertyName = "perTryTimeout", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public string PerTryTimeout { get; set; }
Property Value
Type | Description |
---|---|
string |
RetryRemoteLocalities
Flag to specify whether the retries should retry to other localities. See the retry plugin configuration for more details.
Declaration
[JsonProperty(PropertyName = "retryRemoteLocalities", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public bool? RetryRemoteLocalities { get; set; }
Property Value
Type | Description |
---|---|
bool? |
retryOn
Specifies the conditions under which retry takes place. One or more policies can be specified using a ‘,’ delimited list. See the retry policies and gRPC retry policies for more details.
Declaration
[JsonProperty(PropertyName = "retryOn", Required = Required.Default, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public string retryOn { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Validate()
Validate the object.
Declaration
public virtual void Validate()
Exceptions
Type | Condition |
---|---|
ValidationException | Thrown if validation fails. |