Multiple persistence units with WebSocket reactive messaging? #28853
-
Hello, I have the following problem: I need to use reactive messaging (WebSockets) in combination with multiple datasources (Hibernate ORM). Due to having multiple datasources, I can't use HIbernate Reactive. But at the same time, when I try to use a Panache repository in an
I've tried returning a Uni from my repository method and resolving it asyncrhonously, but I still have this error, as the Hibernate library is the regular one, not the reactive. Is there a way to:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
/cc @cescoffier, @ozangunalp |
Beta Was this translation helpful? Give feedback.
-
I think you are using the Java websocket API, not the reactive messaging, if you are using If I am not mistaken Hibernate Reactive doesn't support multiple persistence units. This issue mentions it #21110. You can use Hibernate ORM (not reactive) with multiple persistence units, but you can't call blocking API on an IO thread, as the exception tells. If you add |
Beta Was this translation helpful? Give feedback.
-
Yeah, turns out I was wrong, and You'd need to set You'd also need to add |
Beta Was this translation helpful? Give feedback.
Yeah, turns out I was wrong, and
@Blocking
doesn't work in that case. I am sorry for the confusion.You'd need to set
quarkus.websocket.dispatch-to-worker=true
config inapplication.properties
for websocket methods to be called on worker threads instead of IO threads.You'd also need to add
@Transactional
to methods using Hibernate ORM.