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
Are there expectations regarding the order of callbacks for a @ServerEndpoint? I've got a @ApplicationScoped @ServerEndpoint that has @OnOpen and @OnMessage methods. I was doing a bit of setup work in the OnOpen callback, storing the results in session.getUserProperties, and then attempting to get that value out in OnMessage, but this was periodically failing in OnMessage.
It appears that OnMessage can be invoked before OnOpen completes (easy enough to test - if you set a breakpoint in both methods, you can hit both breakpoints at the same time.) This was surprising to me - is this a bug in Quarkus, or is it expected for onMessage to be invoked before onOpen has completed?
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.
-
Are there expectations regarding the order of callbacks for a
@ServerEndpoint
? I've got a@ApplicationScoped @ServerEndpoint
that has@OnOpen
and@OnMessage
methods. I was doing a bit of setup work in theOnOpen
callback, storing the results insession.getUserProperties
, and then attempting to get that value out inOnMessage
, but this was periodically failing inOnMessage
.It appears that
OnMessage
can be invoked beforeOnOpen
completes (easy enough to test - if you set a breakpoint in both methods, you can hit both breakpoints at the same time.) This was surprising to me - is this a bug in Quarkus, or is it expected for onMessage to be invoked before onOpen has completed?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions