Spring integration: Shutdown application when the handling of files is completed -


how create automatic shutdown in spring integration after finish process files?

my application download undefined number of files , process files sequentially, flow this:

file:inbound-channel-adapter --> transformer --> splitter --> http-outbound-gateway --> int:aggregator --> mail:outbound-channel-adapter. 

at end, should shutdown app.

how know files processed? has experience ?

thanks

in case need track inbound directory. have add step flow (probably track last file). suggest etl technique: read file descriptions process them.

when processed can send event shutdown app.

spring boot application can stopped using configurableapplicationcontext:

springapplication app = new springapplication(application.class); configurableapplicationcontext context = app.run(args); context.close(); 

also there way using spring actuator shutdown endpoint: see how shutdown spring boot application in correct way?

spring boot documentation


Comments