pmpm
pmpm

Reputation: 705

Handling automatic retry in Jetty Client

In Jetty 8, there used to be this:

But I don't see any equivalent in new API nor any mention in:

And as per this answer it does not seem to be possible:

How can I configured maxRetries and the methods that are allowed to be retried in Jetty client ?

I am looking for something similar to this:

Upvotes: 1

Views: 717

Answers (1)

sbordet
sbordet

Reputation: 18537

The TLDR answer is that you have to write your own retry listener.

In this way, you have full control on the retry delay policy, whether or not to change URI, or method, etc.

Furthermore, automatic retry give the false impression that they are available for all requests, but a request with non-reproducible content (e.g. one read from an InputStream that can be consumed only once) cannot be retried.

Also, non-idempotent requests should not be retried.

In summary, there is too much custom logic that will be best implemented by applications rather than by Jetty.

Upvotes: 3

Related Questions