What is the use of SharedHttpClient

100 views
Skip to first unread message

domis...@gmail.com

unread,
Apr 12, 2022, 4:43:13 PM4/12/22
to vert.x
Hi,

As the title entails what is the use of SharedHttpClient and what are the benefits of using it.

In what scenarios and cases should it be used, especially when working with WebClient, that afaik, can be called from any context?

If in our use, each verticle has its own client, is there a purpose to use this?

Is the SharedHttpClient only meant to be used when passed around many verticles?
If so, does that not overlap how the WebClient works?

Thomas SEGISMONT

unread,
Apr 13, 2022, 3:39:08 AM4/13/22
to ve...@googlegroups.com
Hi,

I believe this doc section should answer your question about the purpose of the shared HttpClient:

A WebClient instance can be created from any HttpClient, including a shared one.

Regards,
Thomas

--
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/2db4b5b5-d25f-46a1-8623-2381b94d7ecfn%40googlegroups.com.

domis...@gmail.com

unread,
Apr 13, 2022, 12:11:41 PM4/13/22
to vert.x
Hi,

Isint it safe already to share a webclient around, since it uses the caller eventloop the execute?

Thomas SEGISMONT

unread,
Apr 13, 2022, 1:04:07 PM4/13/22
to ve...@googlegroups.com
It is safe to share a WebClient instance. The added value of a shared client is that:

- it can be retrieved by name in a verticle instance
- it can be configured to use several event loops

Le mer. 13 avr. 2022 à 18:11, domis...@gmail.com <domis...@gmail.com> a écrit :
Hi,

Isint it safe already to share a webclient around, since it uses the caller eventloop the execute?


On Wednesday, April 13, 2022 at 12:39:08 AM UTC-7 tsegi...@gmail.com wrote:
Hi,

I believe this doc section should answer your question about the purpose of the shared HttpClient:

A WebClient instance can be created from any HttpClient, including a shared one.

Regards,
Thomas

Le mar. 12 avr. 2022 à 22:43, domis...@gmail.com <domis...@gmail.com> a écrit :
Hi,

As the title entails what is the use of SharedHttpClient and what are the benefits of using it.

In what scenarios and cases should it be used, especially when working with WebClient, that afaik, can be called from any context?

If in our use, each verticle has its own client, is there a purpose to use this?

Is the SharedHttpClient only meant to be used when passed around many verticles?
If so, does that not overlap how the WebClient works?

--
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/2db4b5b5-d25f-46a1-8623-2381b94d7ecfn%40googlegroups.com.

--
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.

Yaduvesh Sharma

unread,
Oct 31, 2023, 5:56:32 AM10/31/23
to vert.x
"- it can be configured to use several event loops "
Hi Thomas,
Is it possible to use several event loops as part of WebClient(HttpClient) even without explicitly setting 'shared=true' on the Webclient?

I am using a WebClient which is created outside of verticles, and all verticle instances re-use the same webclient instance to make requests. In this case, is there any need for setting 'shared=true' on this common webclient?

Thanks
Reply all
Reply to author
Forward
0 new messages