Hello everyone.
I hope to be helpful by submitting this question, since I don't know well how to structure batches with spring boot.
I'm trying to understand if the code I wrote can run into any problems and how I could improve it. I quickly created this portion of code with the intention of running the batch once a day (because I don't have the possibility to keep the application running for more than 8 hours a day ) and to run a job at a pre-established time defined in a database. I want to use spring libraries only. Forgive me about using regular standard output, I hope the code comments itself:
I would like the application to terminate when the job is executed, for this reason I have created an Executor which in parallel verifies that the scheduler task is complete and then cancels the task scheduler and exit from application, I would like to understand if there is a better methodology.
Is there a spring boot
pattern i can follow for better implementation?