You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implementing a websocket method for handling messages (@OnMessage), it is not possible to call something that blocks:
2022-09-06 14:15:12,046 INFO [io.dro.iot.hac.eve.WebSocketEndpoint] (vert.x-eventloop-thread-3) Failed to handle message: java.lang.IllegalStateException: The current thread cannot be blocked: vert.x-eventloop-thread-3
at io.smallrye.mutiny.operators.uni.UniBlockingAwait.await(UniBlockingAwait.java:30)
at io.smallrye.mutiny.groups.UniAwait.atMost(UniAwait.java:65)
at io.smallrye.mutiny.groups.UniAwait.indefinitely(UniAwait.java:46)
at io.quarkus.security.runtime.QuarkusIdentityProviderManagerImpl.authenticateBlocking(QuarkusIdentityProviderManagerImpl.java:132)
at io.quarkus.security.identity.IdentityProviderManagerCreator_ProducerMethod_ipm_91f102be1b2a781216db8a81e6ab4b9b1a84f03c_ClientProxy.authenticateBlocking(Unknown Source)
at io.drogue.iot.hackathon.events.EventSession.handleAccessToken(EventSession.java:83)
However I cannot find any explanation how to run anything async (using a Uni) inside a WebSocket method.
Assuming I have a Uni, how can I subscribe to the outcome of the operation, so that it works in context with WebSocket. An example would be helpful to other too I guess.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When implementing a websocket method for handling messages (
@OnMessage
), it is not possible to call something that blocks:However I cannot find any explanation how to run anything async (using a
Uni
) inside a WebSocket method.Assuming I have a
Uni
, how can I subscribe to the outcome of the operation, so that it works in context with WebSocket. An example would be helpful to other too I guess.Beta Was this translation helpful? Give feedback.
All reactions