Should OnClose run before ShutdownEvent? #8303
Unanswered
krzemienmichal
asked this question in
Q&A
Replies: 1 comment 2 replies
-
How are you stopping the server? You could use your own LifeCycle bean |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using Micronaut version 3.2.6
I have Websocket server application and I've got a problem which I'm not sure if it's a bug or it works as intended.
To be specific inside my Websocket server class I'm defining
@OnClose
method and custom onShutdown method which is annotated with@EventListener
and uses ApplicationShutdownEvent. In case of application closure without any open connections custom shutdown methods work fine, however if there's any open connection@OnClose
method runs firstly and close connection with AbnormalClosure reason, then shutdown event works.Is this correct behavior? Do you have any ideas how I can solve this in such a way that shutdown event will work before OnClose and send correct ClosureReason?
I found that someone had similar problem in thread #6354 but it's and old thread and it was not answered there.
Let me know if you need more details.
Thanks for help in advance.
Beta Was this translation helpful? Give feedback.
All reactions