Announcement Announcement Module
Collapse
No announcement yet.
Is it a Spring batch compliant scenario? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it a Spring batch compliant scenario?

    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.

  • #2
    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?

    Comment


    • #3
      Thanks for reply

      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

      Comment


      • #4
        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.

        Comment


        • #5
          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

          Comment


          • #6
            Originally posted by sotretus View Post
            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.

            Comment


            • #7
              Still, if you are processing it IN THAT MOMENT, it is not batch, it is online.

              Comment


              • #8
                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.

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    Originally posted by sotretus View Post
                    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.

                    Comment

                    Working...
                    X