File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring Integration and Spring Batch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Integration and Spring Batch" Watch "Spring Integration and Spring Batch" New topic
Author

Spring Integration and Spring Batch

jianming chen
Ranch Hand

Joined: Jul 21, 2009
Posts: 33
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?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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?

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Gunnar Hillert
Spring Integration Committer
Greenhorn

Joined: Oct 31, 2012
Posts: 5
Hi,

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)

We talked a little bit about those options in our recent (2012) SpringOne talk: http://www.slideshare.net/hillert/introduction-to-spring-integration-and-spring-batch
There will also be an audio/video recording of that presentation available in the upcoming weeks/months.

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.

Cheers,

Gunnar

Disclaimer: I am a Spring Integration committer
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

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.


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
 
 
subject: Spring Integration and Spring Batch
 
Similar Threads
Spring Roo - questions
Annotations and OSGI
Spring / Tiles 2 example
spring integration philosophy
Spring Batch