Feb 21st, 2012, 01:34 PM
Is Spring batch a good fix for my current project?
I'm investigating whether spring batch is a good fit for a project that I'm working on and would love the community's input if possible.
I'm receiving xml over http with a bunch of id's
What I need too do is call a method (over RPC) getProductInfoById(int id), for each enter in the xml file. I'd like too batch this up into groups of 5 and call getProductInfoById(int id) on each group of 5, then use Spring batch for failure recovery, retry etc......store result of each call in a db.
Is spring batch a good fix for this try of project?
thanks in advance
Feb 21st, 2012, 02:25 PM
Did you look at Spring Integration ?
Feb 21st, 2012, 03:03 PM
Ya, I'm reading Chapter 11 of Spring Batch in Action at the moment. Everything that I've read in this book so far tells me that its not a great fit.
I need to batch requests, and provide failure recovery, retry etc..... I could read from a db and store results of the request back into a db....but the middle part (processing), this is where I need to make http requests.
I know even less about spring integration than I do about spring batch, but from what I've read, it's not a good fit cause I cannot use JMS messaging. Both from the source where I get my data and the clients that I'll update with new product info.
Basically, am I right by thinking that spring batch doesn't support http requests as part of the whole patch process?
Feb 22nd, 2012, 09:54 PM
JMS is not a must for Spring Integration. I have used Spring integration just to call web services over http for example and other kinds of processing like DB updates etc as well as reading JMS messages of queues etc.
That being said why are you saying that you cannot call HTTP requests in the Spring batch. Spring batch is nothing but built on top of spring. I am new to Spring Batch currently doing a POC for a task that I have been assigned to...take a look at ItemProcessor ..I think you would be able to do any kind of processing in that after reading and before writing for example.
Feb 23rd, 2012, 10:11 AM
thanks Sambaran, will do
Feb 25th, 2012, 11:44 AM
What I am finding is that for most process/workflow types of things I am using a combination of Spring Integration and Spring Batch. I use Spring Integration for the inbound and outbound application integration points and Spring Batch for the data processing work. The nice thing about Spring Batch, if you use the meta-data tables, is that you have a record of the execution of your process and have the ability restart on failure. Even if your process is very simple and not necessarily a Batch application, with Spring batch you have visibility into the execution of your application without parsing through log files.