Replies: 4 comments 12 replies
-
Beta Was this translation helpful? Give feedback.
-
To save resources, you can share the http client between two rest clients. RestClientBuilder.newBuilder()
.baseUri(URI.create(basseUrl))
.property("io.quarkus.rest.client.connection-pool-size", 50)
.build(WebClient.class)
.property(QuarkusRestClientProperties.NAME, "my-client-group")
.property(QuarkusRestClientProperties.SHARED, true); Under the hood, with this setting, Quarkus will use shared Vert.x HTTP Client |
Beta Was this translation helpful? Give feedback.
-
@michalszynkiewicz Notice the
It only logs info about the request and response, but no low level info about Netty. All this project does is to send a GET request every 5 seconds: @Scheduled(
every = "5s",
concurrentExecution = SKIP
)
public void runClient() {
var urls = List.of(
"https://docs.python.org/3/whatsnew/3.10.html",
"https://docs.python.org/3/whatsnew/3.9.html",
"https://docs.scala-lang.org/tour/higher-order-functions.html",
"https://docs.scala-lang.org/tour/traits.html"
);
urls.forEach(
url -> webClient.doGETRequest(url)
.subscribe().with(resp -> {
if (resp != null)
Log.debugf("Received %s bytes...", resp.getBytes().length);
else
Log.debugf("UNI produced null...");
})
);
} |
Beta Was this translation helpful? Give feedback.
-
I've the same scenario, was there a resolution to this? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have an application where I get multiple urls with different base urls. I don't know the base URLs so I can't add them all in the config file. What I am currently doing is creating a new client for each base URL. Something like:
This is working, but I am not sure if this is inefficient. I guess if there is a new thread pool being created for ach base URL this is very inefficient. So:
Is one connection created or 2?
Beta Was this translation helpful? Give feedback.
All reactions