Multithreaded processing of data with spring batch
I am looking for a help with simple (I think so) problem with spring batch. My task is to read list of transactions from database, group them by account number and order by date and later on do some processing for set of transactions for specific account number.Once I read data and group them by account number I can process these chunks in parallel. Every such operations will update account balance. I am new to spring ba开发者_JAVA技巧tch and looking for example of spring configuration. Can you help me?
Check the samples in Spring Batch : http://static.springsource.org/spring-batch/spring-batch-samples/index.html#parallel This one shows you how tu se parallelism. For reading in a database, check the Hibernate sample (if you use Hibernate).
Reading you, I think the main difficulty will be to execute a set of accounts in 1 transaction. Spring Batch will process every object in a single transaction. I suggest you send to the executor a bunch of objects you need to process.
Try the samples from the beginning : one item after the other, check how to use parallelism, then work on your problem. It will be easier if you have a little experience on simple samples.
精彩评论