Graceful Shutdown is Spring Boot along with @PreDestroy | Tech Primers

preview_player
Показать описание
This video covers how you can leverage grace-period property in Spring Boot with @PreDestroy to gracefully shutdown the JVM.

🔗Related Videos
============

📌 Related Playlist
================

🎬Video Editing: FCP
🎼Background Music:
Joakim Karud
Dyalla

---------------------------------------------------------------
🔥Disclaimer/Policy:
The content/views/opinions posted here are solely mine and the code samples created by me are open sourced.
You are free to use the code samples in Github after forking and you can modify it for your own use.
All the videos posted here are copyrighted. You cannot re-distribute videos on this channel in other channels or platforms.
#SpringBoot #Shutdown #TechPrimers
Рекомендации по теме
Комментарии
Автор

Excelent content and great example of keeping your ongoing job even though the JVM was exited.

Thanks again!

kalilmvp
Автор

It would be great to have you as a boss. Would enjoy coming to work everyday. Please do a more detailed version of batch.

mikecmw
Автор

Thanks and always your videos are very useful 👍

venkatah
Автор

Thank you for the video. I have been looking for similar solution.

dheerajvishwakarma
Автор

For this shutdown hook I can one use case here I am stuck now. I am using quartz scheduler in my java application and when somehow due to jenkins nightly build my app can get stop signal any time. And at that point of time my quartz scheduler is busy doing some of job. The problem is quartz scheduler is creating it's own Threads without using any thread pool. And now if it's busy with job processing and someone stops my app in between then some of quartz jobs will be in incomplete state which stops my application to start again. Because whenever my application starts the quartz just check if previously any job was there which is incomplete then it ll try to complete those job but due to stop signal quarts was not able to add some entries in DB table and those entries are missing and quarts will not allow my app to start again.

ompalshekhawat
Автор

great vid, can you explain why having thread pool in spring application makes it monolith?

mercury
Автор

Your demo is excellent but application would be multiple child processes and threads within the application at various/different places but they are all running on the same JVM....how are we going to resolve this issue?

ScoobyDoo-ctnd
Автор

Hi When enabled graceful shutdown and JVM shutdowns because of out of memory. Will it still try to wait for finishing off the active thread

savithamylswamy
Автор

We could use executors.awaitTermination(5, TimeUnit.SECONDS) for executing tasks to be completed instead of getActiveCount and sleep.

SushilYadav
Автор

Thanks for helpful video. I have an app which expose single endpoint returning approved/denied as response.
I want to gracefully shut down spring boot app if my endpoint returns denied for multiple calls for last 60 secs.
Appreciate any inputs. Thanks in advance

pranavtallewar
Автор

Hi ! Can you tell how to invoke jvm hook in apache camel routes? Like, i have two routes. I am executing a one route and i stopped the flow. now i want the second route should always run? If you can tell such kind of implementation in spring, it will work for me

ashimasood
Автор

Is there a more elegant way of waiting active threads to finish rather than using Thread.sleep?

erickdelrey
Автор

Hi,
How do you load the project from terminal to Intellij, using command?
Is it something, I need to configure?

shaswatdasgupta
Автор

How to do graceful shutdown for spring boot with kafka streams?

eugenicko
Автор

Hi ajay, when you will make QA guess this is the good time to take QA session.♥️

sbshshendkar
Автор

I would add for anyone using Eclipse as your IDE. This does not work if you run in the console. Not sure why. If you simply create the jar and run that with java -jar app.jar and hit cont-C while in sleep, this will work...

mikecmw
Автор

Just tried the same in my machine with spring boot 2.3.1 release and Java 8 with the latest properties as per spring doc like server.shutdown as GRACEFUL and to 30s and its just stopping abruptly not like gracefully by waiting until current requests are processed

mohansaich
Автор

Instead you can make child thread call blocking.

UCTNXPiSlAhgUyGlBwg
Автор

Hello Sir, if app is running on Linux env. We can terminate using "kill PID" command i.e soft kill. How it is different from graceful shutdown feature added by Spring community in latest release.

saurabhsingh