--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/320a067e-2f06-46a1-b414-fea0ac30876fn%40googlegroups.com.
//TODO: la prima stage viene eseguita su un executor-thread, potrebbe rallentare se sotto alto carico
return Uni.createFrom().item(command.getNegozio()).map( negozioPK -> {
Negozio negozio = negozioRepository.findById(negozioPK).get();
URI uri = uriBuilder.apply(negozio);
log.info("REQUEST -> " + uri.toString());
return uri;
})
.chain( uri -> Uni.createFrom().completionStage(client.target(uri).request().rx().get()) )
.chain( response -> {.......});
That's what I'm trying to figure out, but the reproducer works as expected, running everything on the event-loop thread.It's only a UriBuilder that creates an URI that run on the executor-thread but1) I hate when I don't understand something I thought I know2) That can impact performance under heavy load
As always, thank you @Georgios Andrianakis !!!!
negozioRepository.findById
@GET
@Path("test/{myParam}")
public Uni<Response> testUni(@PathParam("myParam") String myParam, @Context UriInfo uriInfo) {
return Uni.createFrom().item(myParam).map( p -> {
// this is a memory fetch, so I decided to leave it imperative
Negozio negozio = negozioControl.getSingle();
log.info(negozio.getNomeNegozio());
return uriInfo.getBaseUriBuilder().path("q/dev").build();
})
.chain( uri -> Uni.createFrom().completionStage(client.target(uri).request().rx().get()) )
.chain( response -> {
log.info(response.toString());
return Uni.createFrom().item(response);
} );
}
2021-04-02 12:46:51,623 INFO [xxx] (vert.x-eventloop-thread-8) Laboratorio yyyy
2021-04-02 12:46:51,624 INFO [io.qua.htt.access-log] (vert.x-eventloop-thread-12) 127.0.0.1 - - 02/Apr/2021:12:46:51 +0200 "GET /resources/q/dev HTTP/1.1" 307 -
2021-04-02 12:46:51,625 INFO [xxx] (vert.x-eventloop-thread-6) org.jboss.resteasy.reactive.client.impl.ClientResponseImpl@562a065e
2021-04-02 12:46:51,626 INFO [io.qua.htt.access-log] (vert.x-eventloop-thread-0) 0:0:0:0:0:0:0:1 - admin 02/Apr/2021:12:46:51 +0200 "GET /resources/test/prova HTTP/1.1" 307 -
going on trying to create a reproducer.
Thanks
In:
return Uni.createFrom().item(command.getNegozio()).map( negozioPK -> {
Negozio negozio = negozioRepository.findById(negozioPK).get();
URI uri = uriBuilder.apply(negozio);
log.info("REQUEST -> " + uri.toString());
return uri;
})
.chain( uri -> Uni.createFrom().completionStage(client.target(uri).request().rx().get()) )
.chain( response -> {.......});
There are a few things to check:1. what does command.getNegozio() do, and it is returning a Supplier (in that case on which thread the item is emitted).2. I'm seing a findById().get(), hopefully, this is not using CompletionStage, because if it does that would be blocking.3. The client.target(...).request().rx().get() is also suspicious. First "rx", is it related to Reactive eXtensions? If not (and don't believe it does), is it returning a CompletionStage? In this case, veriy on which thread it emits, probably the fork join (do not use this in a container)Clement
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAG%3D-wFPwfZ9kjbbpPjgha9Z2U186%2BAnoiO-fi%3Dt4k3iSv5SXng%40mail.gmail.com.
quarkus.http.auth.basic=true
RULE trace executor context switch
CLASS org.jboss.threads.EnhancedQueueExecutor
METHOD execute
AT ENTRY
IF true
DO traceStack("Context Switch: \n");
ENDRULE
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAG%3D-wFNHM8gRGe_AXpx0jn9sVWTokQP3fW0mUsp-qcfgdJgL4A%40mail.gmail.com.