Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure rest client in quarkus microprofile case

When using Quarkus microprofile as a rest client, how can I configure underlying HttpClient? Like number of retries, connection pool size per host and so on? Also is it possible to force client restart somehow (so connections pool will be restarted)?

like image 958
Konstantin Kulagin Avatar asked Sep 15 '25 20:09

Konstantin Kulagin


1 Answers

https://download.eclipse.org/microprofile/microprofile-rest-client-2.0-RC2/microprofile-rest-client-2.0-RC2.html#_configuration_keys outlines the full set of configuration keys that can be used.

The ones you're looking for are:

{packageName}.{interfaceName}/mp-rest/connectTimeout
{packageName}.{interfaceName}/mp-rest/readTimeout

The RestClientBuilder also has methods for setting those properties if you're using the programmatic API instead of the CDI approach.

I'm not aware of any means of restarting the underlying HTTP client connection pool. What would be the use case for such a situation that doesn't require the whole application to be restarted?

like image 140
Ken Avatar answered Sep 19 '25 14:09

Ken



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!