This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I used Spring integration in a lot of cases and really liked it. And I found it is also very handy to create cron integration jobs by using polling channel.
But in the case like I have huge files to process nightly, I can use Spring integration to do the work, but Spring Batch looks like more appropriate for the work.
so what is the best argument to make choice?
There doesn't have to be a choice. As a matter of fact a huge amount of Spring Batch Jobs also uses Spring Integration. Because many times the processing requires talking to many systems and Spring Integration really helps out there.
Sometimes Spring Integration can be used to fire off a Batch job. For instance, wouldn't it be cool that if a Batch job fails you receive a tweet on twitter that you can reply back to to fire a rerun of the job?
Take a look at chapter 16 of "Spring Integration in Action": "Integrating Spring Batch and Spring Integration". It provides a very good overview of how to integrate Spring Batch and Spring Integration:
* Launching batch jobs through messages
* Providing feedback with informational messages (via StepListener, ChunkListener, JobExecutionListener)
* Externalize batch process execution (Call Spring Integration from inside batch jobs)
As Spring Integration and Spring Batch are under the same umbrella of Spring projects, you will see an increasingly tighter integration between Spring Batch and Spring Integration. As for your specific situation, take a look at the features provided by Spring Batch. I believe one could make an argument that for simple use-cases with small batch files, you can do the job efficiently using Spring Integration only (Use the simple/more generic tool first). However, if you start dealing with massive files that don't easily fit into memory anymore, take a very long time to process, and you start feeling the pain, then you probably need to seriously consider Spring Batch. Other people may have a different view point but I hope this provides you with some useful guidance.
I'd say Spring Batch would fit the bill when you need to do BATCH processing - Batch frameworks have a shared vocabulary & need. Batch provides features like re-startability, chuck-commit, multi-threading support out of the box.
Spring Batch also offers a lot of the shelf Reader and Writer components - that make writing batch jobs more standard and easy.
If you are looking for these features for a "Job" why re-invent the wheel - use Spring Batch.