How to create automatic shutdown in spring integration after finish all process for all file? My application use a lot of file as input and use http outbound gateway as last endpoint, so i have http outbound request for each file input , and i try to use the last http response from that endpoint as the trigger to shutdown (context.close()) the spring integration. My idea is try to use (System.currentTime()-lastTimeGatewayResponse)>= idleTime as trigger . But i did not find way to get lastTimeGatewayResponse from that gateway.
And afterward I try to folow http://forum.spring.io/forum/spring-projects/integration/116366-orderly-shutdown-how-to-know-when-downstream-executor-is-idle. But mybe that not the best aproach, because my application has shutdown while the the process unfinish.
Anyone has experience about that?
Thanks