Send message to UI just before the JVM shutdown

I want to send the message to the UI/ client side just before the JVM shutdown. So is it possible to do it?
Another thing is that in Hilla, the frontend and backend use the same server so If JVM shutdown then how does the UI handle the sent message??

You probably want to use

And the post a message to Flux, that sends it to client

Here is a simplified event service using Flux hilla-v2-demo/src/main/java/com/example/application/services/ at master · TatuLund/hilla-v2-demo · GitHub

And just subscribe to you event endpoint hilla-v2-demo/frontend/views/todo/useTodos.tsx at master · TatuLund/hilla-v2-demo · GitHub

@visionary-wombat can we check it.