View Full Version : Is it a Spring batch compliant scenario?
sekobo
Aug 17th, 2007, 11:56 AM
This is my use case:
- I receive job demands through a WebService, and have to run a business job passing some input data coming from the WebService request.
Notes that I can run the same job many times or in parallel, depending on jobs demand I receive.
It is a spring batch scenario? I think so,
And can some body give me the spring xml config skeleton, it will help to have a concrete view of the implementation.
Thanks.
Dave Syer
Aug 17th, 2007, 02:35 PM
Not sure if I can help with the particular scenario you mention without more information about the jobs. Did you see the samples? There are quite a few configuration "skeletons" for want of a better word. Maybe they would help?
sekobo
Aug 20th, 2007, 09:19 AM
I have seen the example, and some aspects are now clear but I still have a little question.
Just consider the simpleTaskletJob and think that the fileName to process is coming from a web service, can you tell me how can I do to fullfill this request, and also consider that the WebService could receive many request and I have to run many job processing different files.
Thanks
Dave Syer
Aug 20th, 2007, 10:18 AM
I think the best approach would be to wrap a JobLauncher or JobExecutorFacade in your web service, replacing or duplicating the SimpleCommandLineLauncher. N.B. the API is undergoing some changes there - should be stable when we get to m2.
sotretus
Aug 29th, 2007, 09:49 AM
This is my humble opinion, but this sounds more like an online scenario than a batch one, specially because you are returning the response in a synchronous way. What benefits do you think you can get from this framework?
A more batch-like scenario could be if you save your requests and then want to process them all together. and reply afterwards.
Regards
AB
sekobo
Aug 29th, 2007, 10:19 AM
This is my humble opinion, but this sounds more like an online scenario than a batch one, specially because you are returning the response in a synchronous way. What benefits do you think you can get from this framework?
A more batch-like scenario could be if you save your requests and then want to process them all together. and reply afterwards.
Regards
AB
The response that I want to send will just have some information about the status of the submited job and the job identifier, because after sending a job submission request I want to monitor the job online using his id.
sotretus
Aug 29th, 2007, 10:22 AM
Still, if you are processing it IN THAT MOMENT, it is not batch, it is online.
sekobo
Aug 29th, 2007, 10:30 AM
No the job request could even join a pending list to be processed another day, and my purpose is to still have the hability to monitor this kind of informations.
sotretus
Aug 29th, 2007, 10:41 AM
Oh, sorry didn't understand that from your first message. In that case it surely seems like a Batch process. But I suggest you decouple the "channel" (i.e the web service) from the processing. Store the data in a database and then make Spring Batch get the data from it.
This will allow you to have new channels in the future, and reuse your batch and business logic.
sekobo
Aug 29th, 2007, 11:08 AM
Still, if you are processing it IN THAT MOMENT, it is not batch, it is online.
No the job request could even join a pending list to be processed another day, and my purpose is to still have the hability to monitor this kind of informations.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.