Announcement Announcement Module
Collapse
No announcement yet.
Retryable batch problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Retryable batch problem

    Hi ,
    I have been trying to write different batch. I finished writing Hello World batch. It does not do anything but implements a tasklet .
    I have some queries

    - Can i directly work with spring batch framework without studying basic spring framework ?
    - Now i want to go further and explore other features of batch processing like retryable batch job.
    I could find code snipplet which gives basic retrying feature from www.springframework.org ,

    RetryTemplate retryTemplate = new RetryTemplate();
    retryTemplate.setRetryPolicy(new SimpleRetryPolicy(5));
    Object result = retryTemplate.execute(new RetryCallback() {
    public Object doWithRetry(RetryContext context) throws Throwable {
    // do some processing
    return result;
    }
    });

    If i want my batch to be retriable , where exactly this code has to be placed ?
    Where can i get samples .?
    Awaiting for some light.

  • #2
    Originally posted by prana View Post
    Hi ,
    - Can i directly work with spring batch framework without studying basic spring framework ?
    Yes, probably, but I don't know if I would advise it. We did not design Spring Batch to be used by someone who knows nothing about Spring - it's the same programming model.

    Originally posted by prana View Post
    Hi ,
    Where can i get samples .?
    You already have the Spring Batch samples right? Spring programming examples are pretty easy to come by in the Spring distro, and the reference guide (http://static.springframework.org/sp...nce/index.html).

    If i want my batch to be retriable , where exactly this code has to be placed ?
    It depends how you want the retry to behave. Maybe nowhere if you use a RetryPolicy in the step. Maybe that's not what you mean though. What scope do you want the retry to have (you said "batch", but that means different things to different people, and isn't part of our domain language)?

    If you implement your own Tasklet, then it may need to handle retry internally (in 1.0.0.m4 the transaction boundaries are also expected to be handled by a custom Tasklet, if you go down that route), if the scope of the retry is smaller than a step. In that case the imperative style you quoted could go in the Tasklet itself (or you could do it declaratively with the RetryOperationsInterceptor).

    Comment


    • #3
      Thanks Dave for prompt response. Will try it out.

      Comment


      • #4
        Plz help

        Hello Prana

        I see you have finished the first sample. Please help me. I am very new to spring batch.

        As guided by the website I followed the following steps

        mvn install-in cmd prompt
        mvn eclipse:eclipse-in cmd prompt
        And I configured external tools to eclipse.
        I run src/test/java in eclipse
        Itseems runs fine.

        I dont know the above steps are correct or not. If there is any error pls forgive me.

        Can u tell me the exact steps to run the spring batch sample and also I want to create my own sample. Where do I check my output.

        Thanks in advance. Please help me...........

        Comment

        Working...
        X