Vertx web/http client retry

818 views
Skip to first unread message

PAVAN PURANIK

unread,
Sep 20, 2019, 5:23:01 AM9/20/19
to vert.x
Hello, Vertx community,
Can anyone please help me if there is a support for retry mechanism like how we have for https://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.html.

Regards,
Pavan

Julien Viet

unread,
Sep 23, 2019, 5:21:41 PM9/23/19
to vert.x
Hi,

now there is no such feature for the HttpClient nor the WebClient.

It seems pretty easy to implement with an WebClient interceptor, although it is part of the internal API (casting WebClient to WebClientInternal) we should make this API public in Vert.x 4 as it seems quite stable now.

Julien

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/03b021da-17e2-4651-b9cc-caccd4bd654a%40googlegroups.com.

Julien Ponge

unread,
Sep 24, 2019, 9:26:14 AM9/24/19
to ve...@googlegroups.com
You may look into the RxJava 2 bindings, and use the retry operator.

- Julien

> On 20 Sep 2019, at 11:23, PAVAN PURANIK <pura...@gmail.com> wrote:
>

Julien Viet

unread,
Sep 26, 2019, 2:44:04 AM9/26/19
to vert.x
that's a great suggestion
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/464C3839-AC55-4B80-AB1A-AC187C1FB5AF%40gmail.com.

Vendy

unread,
Oct 6, 2019, 5:23:06 AM10/6/19
to vert.x
If the token were expired , how can I replace the token of header by retry operator ?
 


Julien Ponge於 2019年9月24日星期二 UTC+8下午9時26分14秒寫道:
You may look into the RxJava 2 bindings, and use the retry operator.

- Julien

> On 20 Sep 2019, at 11:23, PAVAN PURANIK <pura...@gmail.com> wrote:
>
> Hello, Vertx community,
> Can anyone please help me if there is a support for retry mechanism like how we have for https://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/DefaultHttpMethodRetryHandler.html.
>
> Regards,
> Pavan
>
> --
> You received this message because you are subscribed to the Google Groups "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ve...@googlegroups.com.

Julien Ponge

unread,
Oct 7, 2019, 3:42:27 AM10/7/19
to ve...@googlegroups.com
It’s a bit more complex and depends on what your code looks like.

Perhaps you can do it with an operation before the retry, like a map or flatMap that enriches some data with the token. In this case when retry() kicks-in due to a network / HTTP error then your intermediary operation puts a new one here.

- Julien
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/80313a56-d2d7-464a-ab97-b7af7eb7471d%40googlegroups.com.

Javen Wang

unread,
Oct 10, 2019, 10:38:21 PM10/10/19
to vert.x
what about Circuit Breaker?
Reply all
Reply to author
Forward
0 new messages