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 RetryClient.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 RetryClient.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 RetryClient.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 RetryClient.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 RetryClient.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 RetryClient.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 RetryClient.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 RetryClient.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 RetryClient.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. The RetryClient.submit() function does not give out a http:Response as the result. Rather it returns an http:HttpFuture, which can be used to do further interactions with the endpoint.
getResponse Retrieves the http:Response for a previously submitted request.
hasPromise Checks whether an http:PushPromise exists for a previously-submitted request.
getNextPromise Retrieves the next available http:PushPromise for a previously-submitted request.
getPromisedResponse Retrieves the promised server push http:Response message.
rejectPromise Rejects an http:PushPromise. When an http: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 RetryClient.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)
  • An http:Response message or else an http:ClientError if the invocation fails

The RetryClient.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)
  • An http:Response message or else an http:ClientError if the invocation fails

put

(string path, RequestMessage message)

returns Response | ClientError

The RetryClient.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)
  • An http:Response message or else an http:ClientError if the invocation fails

forward

(string path, Request request)

returns Response | ClientError

The RetryClient.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)
  • An http:Response message or else an http:ClientError if the invocation fails

execute

(string httpVerb, string path, RequestMessage message)

returns Response | ClientError

The RetryClient.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)
  • An http:Response message or else an http:ClientError if the invocation fails

patch

(string path, RequestMessage message)

returns Response | ClientError

The RetryClient.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)
  • An http:Response message or else an http:ClientError if the invocation fails

delete

(string path, RequestMessage message)

returns Response | ClientError

The RetryClient.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)
  • An http:Response message, or else an http:ClientError if the invocation fails

get

(string path, RequestMessage message)

returns Response | ClientError

The RetryClient.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)
  • An http:Response message or else an http:ClientError if the invocation fails

options

(string path, RequestMessage message)

returns Response | ClientError

The RetryClient.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)
  • An http:Response message or else an http:ClientError 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. The RetryClient.submit() function does not give out a http:Response as the result. Rather it returns an http: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 http:HttpFuture that represents an asynchronous service invocation or else an http:ClientError if the submission fails

getResponse

(HttpFuture httpFuture)

returns Response | ClientError

Retrieves the http:Response for a previously submitted request.

Parameters

  • httpFuture HttpFuture
  • The http:HttpFuture related to a previous asynchronous invocation

  • Return Type

    (Response | ClientError)
  • An http:Response message or else an http:ClientError if the invocation fails

hasPromise

(HttpFuture httpFuture)

returns boolean

Checks whether an http:PushPromise exists for a previously-submitted request.

Parameters

  • httpFuture HttpFuture
  • The http:HttpFuture related to a previous asynchronous invocation

  • Return Type

    (boolean)
  • A boolean, which represents whether an http:PushPromise exists

getNextPromise

(HttpFuture httpFuture)

returns PushPromise | ClientError

Retrieves the next available http:PushPromise for a previously-submitted request.

Parameters

  • httpFuture HttpFuture
  • The http:HttpFuture related to a previous asynchronous invocation

  • Return Type

    (PushPromise | ClientError)
  • An http:PushPromise message or else an http:ClientError if the invocation fails

getPromisedResponse

(PushPromise promise)

returns Response | ClientError

Retrieves the promised server push http:Response message.

Parameters

  • Return Type

    (Response | ClientError)
  • A promised http:Response message or else an http:ClientError if the invocation fails

rejectPromise

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

Parameters