Announcement Announcement Module
Collapse
No announcement yet.
Is Spring batch a good fix for my current project? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is Spring batch a good fix for my current project?

    Hi

    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

    <product_ids>
    <id>1</id>
    <id>2</id>
    <id>3</id>
    <id>4</id>
    <id>5</id>
    .......
    ......
    <id>300</id>
    </product_ids>

    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

    f

  • #2
    Did you look at Spring Integration ?

    Comment


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

      f

      Comment


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

        Comment


        • #5
          thanks Sambaran, will do

          f

          Comment


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

            Comment

            Working...
            X