Results 1 to 2 of 2

Thread: Spring Batch Continues to Process even after exception is thrown

  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Default Spring Batch Continues to Process even after exception is thrown

    Hi,
    I wanted to test in a multi-threaded setup , how will the batch behave if an exception is thrown. So I forcefully throw a RuntimeException in my code. But even after throwing the exception the step continues & rest of the threads continue to process the other records. How ever the status is updated as "FAILED". The log shows the exception as well. So my question is shouldn't have the step been stopped immediately after the exception is thrown ?.

    Regards,

  2. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    351

    Default

    Why stop all of the threads they are processing successfully? The way it currently is setup, as much data that can be processed in this run will be yet still allowing for restart.
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •