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
What exactly is the difference between @PreDestroy and GracefulShutdownCapable
From my understanding:
both will trigger when shutting down the application context
both will block till the function ends (Im not sure what timeout PreDestroy has nor where it is configured)
The differences I could spot are:
GracefulShutdownCapable beans can report on number of pending tasks
GracefulShutdownCapable shutdown function timeouts are globally configurable.
PreDestroy beans will trigger in more cases, such as refreshable beans
Are my statemes correct? Or am I missing something obvious?
Also, in case I want my beans to gracefully be shutdown and refreshed, do i need both @PreDestroy and GracefulllShutdownCapable?
And in that case, which one runs first?
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.
-
What exactly is the difference between @PreDestroy and GracefulShutdownCapable
From my understanding:
The differences I could spot are:
Are my statemes correct? Or am I missing something obvious?
Also, in case I want my beans to gracefully be shutdown and refreshed, do i need both @PreDestroy and GracefulllShutdownCapable?
And in that case, which one runs first?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions