Skip to content

Add RetryHandler with the option to define it on the HttpContext #14

Closed
@rbygrave

Description

@rbygrave
  static HttpClientContext initClientWithRetry() {
    return HttpClientContext.newBuilder()
      .withBaseUrl("http://localhost:8887")
      .withBodyAdapter(new JacksonBodyAdapter(new ObjectMapper()))
      .withRequestListener(new RequestLogger())
      .withRetryHandler(new SimpleRetryHandler(4, 1))
      .build();
  }

With SimpleRetryHandler constructed with max number of attempts and linear backoff in millis.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions