Reactive RESTEasy and Hibernate Panache: Does request‑scoped context survive worker offload?
29K reputation · 26 Aug 2023, 14:19 UTC
Goal: Ensure that request‑scoped data such as the current security principal or MDC context is available inside a Hibernate Panache repository method when it is invoked from a reactive RESTEasy resource that returns a Uni or Multi.
Current behavior: Quarkus automatically off‑loads the blocking Panache call to a worker thread, but it does not propagate @RequestScoped beans or Vert.x thread‑local storage to that thread, so the repository method sees a null or default security identity and any MDC values are lost.
- Is there a built‑in way to make Quarkus flow request‑scoped context across the reactive‑to‑worker boundary?
- Can Vert.x thread‑local storage be configured to travel with Uni/Multi continuations without manual interception?
- Should developers rely on manually capturing and restoring the context, or is a future extension planned to handle this automatically?