Clients - http : RetryClient

Provides the HTTP remote functions for interacting with an HTTP endpoint. This is created by wrapping the HTTP client to provide retrying over HTTP requests.

Constructor

__init

(string url, ClientConfiguration config, RetryInferredConfig retryInferredConfig, HttpClient httpClient)

  • url string
  • Target service url

  • httpClient HttpClient
  • HTTP client for outbound HTTP requests

Remote Methods

post

The post() function wraps the underlying HTTP remote functions in a way to provide retrying functionality for a given endpoint to recover from network level failures.

head

The head() function wraps the underlying HTTP remote functions in a way to provide retrying functionality for a given endpoint to recover from network level failures.

put

The put() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

forward

The forward() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint with inbound request's HTTP verb to recover from network level failures.

execute

The execute() sends an HTTP request to a service with the specified HTTP verb. The function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

patch

The patch() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

delete

The delete() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

get

The get() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

options

The options() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

submit

Submits an HTTP request to a service with the specified HTTP verb. cThe submit() function does not give out a Response as the result, crather it returns an HttpFuture which can be used to do further interactions with the endpoint.

getResponse

Retrieves the Response for a previously submitted request.

hasPromise

Checks whether a PushPromise exists for a previously submitted request.

getNextPromise

Retrieves the next available PushPromise for a previously submitted request.

getPromisedResponse

Retrieves the promised server push Response message.

rejectPromise

Rejects a PushPromise. When a PushPromise is rejected, there is no chance of fetching a promised response using the rejected promise.

Fields

  • url string
  • Target service url

  • httpClient HttpClient
  • Chain of different HTTP clients which provides the capability for initiating contact with a remote HTTP service in resilient manner.

post

(string path, RequestMessage message)

returns Response | ClientError

The post() function wraps the underlying HTTP remote functions in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

The head() function wraps the underlying HTTP remote functions in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

put

(string path, RequestMessage message)

returns Response | ClientError

The put() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

forward

(string path, Request request)

returns Response | ClientError

The forward() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint with inbound request's HTTP verb to recover from network level failures.

Parameters

  • path string
  • Resource path

  • request Request
  • An HTTP inbound request message

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

execute

(string httpVerb, string path, RequestMessage message)

returns Response | ClientError

The execute() sends an HTTP request to a service with the specified HTTP verb. The function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • httpVerb string
  • The HTTP verb value

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

patch

(string path, RequestMessage message)

returns Response | ClientError

The patch() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

delete

(string path, RequestMessage message)

returns Response | ClientError

The delete() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

get

(string path, RequestMessage message)

returns Response | ClientError

The get() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

options

(string path, RequestMessage message)

returns Response | ClientError

The options() function wraps the underlying HTTP remote function in a way to provide retrying functionality for a given endpoint to recover from network level failures.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The HTTP Response message, or an error if the invocation fails

submit

(string httpVerb, string path, RequestMessage message)

returns HttpFuture | ClientError

Submits an HTTP request to a service with the specified HTTP verb. cThe submit() function does not give out a Response as the result, crather it returns an HttpFuture which can be used to do further interactions with the endpoint.

Parameters

  • httpVerb string
  • The HTTP verb value

  • path string
  • The resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (HttpFuture | ClientError)
  • An HttpFuture that represents an asynchronous service invocation, or an error if the submission fails

getResponse

(HttpFuture httpFuture)

returns Response | ClientError

Retrieves the Response for a previously submitted request.

Parameters

  • httpFuture HttpFuture
  • The HttpFuture relates to a previous asynchronous invocation

  • Return Type

    (Response | ClientError)
  • An HTTP response message, or an error if the invocation fails

hasPromise

(HttpFuture httpFuture)

returns boolean

Checks whether a PushPromise exists for a previously submitted request.

Parameters

  • httpFuture HttpFuture
  • The HttpFuture relates to a previous asynchronous invocation

  • Return Type

    (boolean)
  • A boolean that represents whether a PushPromise exists

getNextPromise

(HttpFuture httpFuture)

returns PushPromise | ClientError

Retrieves the next available PushPromise for a previously submitted request.

Parameters

  • httpFuture HttpFuture
  • The HttpFuture relates to a previous asynchronous invocation

getPromisedResponse

(PushPromise promise)

returns Response | ClientError

Retrieves the promised server push Response message.

Parameters

  • Return Type

    (Response | ClientError)
  • A promised HTTP Response message, or an error if the invocation fails

rejectPromise

Rejects a PushPromise. When a PushPromise is rejected, there is no chance of fetching a promised response using the rejected promise.

Parameters