Can I put @NonBlocking everywhere on my resource endpoints using hibernate Panache? #25586
Answered
by
quarkus-bot
bot
omar-zahid
asked this question in
Q&A
-
Reading more from this blog: https://quarkus.io/blog/resteasy-reactive-smart-dispatch/ @PUT
@Path("{id}")
@Transactional
@NonBlocking
public Fruit update(Long id, Fruit fruit) {
if (fruit== null || fruit.name== null) {
throw new WebApplicationException("Fruit name was not set on request.", 422);
}
Fruit entity = Fruit.findById(id);
if (entity == null) {
throw new WebApplicationException("Fruit with id " + id + " was not found.", NOT_FOUND);
}
entity.name = fruit.name;
return entity;
} |
Beta Was this translation helpful? Give feedback.
Answered by
quarkus-bot[bot]
May 15, 2022
Replies: 2 comments 3 replies
-
/cc @FroMage, @Sanne, @gsmet, @loicmathieu, @yrodiere |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
omar-zahid
-
Using @nonblocking in a suspend function will be enough? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/cc @FroMage, @Sanne, @gsmet, @loicmathieu, @yrodiere