Table of Contents

Class DiscoveryHttpMessageHandler

Namespace
Steeltoe.Common.Http.Discovery
Assembly
Steeltoe.Common.Http.dll

A DelegatingHandler implementation that performs Service Discovery

public class DiscoveryHttpMessageHandler : DelegatingHandler, IDisposable
Inheritance
DiscoveryHttpMessageHandler
Implements
Inherited Members

Constructors

DiscoveryHttpMessageHandler(IDiscoveryClient, ILogger<DiscoveryHttpClientHandler>, ILoadBalancer)

Initializes a new instance of the DiscoveryHttpMessageHandler class.

public DiscoveryHttpMessageHandler(IDiscoveryClient discoveryClient, ILogger<DiscoveryHttpClientHandler> logger = null, ILoadBalancer loadBalancer = null)

Parameters

discoveryClient IDiscoveryClient

Service discovery client to use - provided by calling services.AddDiscoveryClient(Configuration)

logger ILogger<DiscoveryHttpClientHandler>

ILogger for capturing logs from Discovery operations

loadBalancer ILoadBalancer

The load balancer to use

Methods

SendAsync(HttpRequestMessage, CancellationToken)

Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.

protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage

The HTTP request message to send to the server.

cancellationToken CancellationToken

A cancellation token to cancel operation.

Returns

Task<HttpResponseMessage>

The task object representing the asynchronous operation.

Exceptions

ArgumentNullException

The request was null.