Replies: 3 comments 8 replies
-
/cc @FroMage (panache), @loicmathieu (panache) |
Beta Was this translation helpful? Give feedback.
-
Can you give us more context ? We will need the enclosing class of the But you can already update the code to return the result of |
Beta Was this translation helpful? Give feedback.
-
@loicmathieu This is called inside the WebSocket onMessage. I need to access or persist data in Hibernate Reactive. I think it's a common use that read/write database in WebSocket onOpen & onMessage method. The following example is simple enough I think. // This runs without problem
@OnOpen
public void onOpen(Session session, @PathParam("roomId") Long roomId) {
Panache.withSession(() -> User.listAll().onItem().invoke(r -> {
System.out.println(r.size());
})).subscribe().with(r -> {
});
}
// This runs with problem
@OnMessage
public void onMessage(Session session, ByteBuffer message, @PathParam("roomId") String roomId) {
Panache.withSession(() -> User.listAll().onItem().invoke(r -> {
System.out.println(r.size());
})).subscribe().with(r -> {
});
} |
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.
-
How to use Quarkus Hibernate Reactive Panach with QuarkusWebSocket? I try to do some Panache Reative stuff. And it reports no current Vertx context found.
Beta Was this translation helpful? Give feedback.
All reactions