I made this spring batch project (csv to database, classic) - works fine: https://github.com/Tyvain/Spring-Batch-Generic-Bulk
On a separate project, I made an app with vaadin where I can upload a file works fine: https://github.com/Tyvain/vaadin-simple-upload-file
-> We need to trigger the job when a file is uploaded.
So I regrouped the 2 projects into one app, with these steps:
- disable batch: job.enabled: false (in application.yml)
- add required vaadin librairies to the pom
- add the view (MainView.java).
Sources of this modifications: https://github.com/Tyvain/Spring-Batch-Generic-Bulk/tree/include-vaadin-upload-page
At this point, I am still not sure how to launch the job, but I face another problem: when I launch the app, it stops. The server, that stay up in the vaadin app, does not stay up here.
Edit: when I remove those annotation from my job configuration, the server stays up:
//@Configuration
//@EnableBatchProcessing
1/ Is it possible to keep my server running with spring-batch enable?
2/ is this a wrong practice ?
Solution working: https://github.com/Tyvain/ProcessUploadedFile-Vaadin_SpringBatch