Results 1 to 2 of 2

Thread: Exception handling

  1. #1
    Join Date
    Aug 2008
    Posts
    21

    Default Exception handling

    Hi

    I have an exception handler for a tasklet. I have configured the handler as a property for the tasklet in context file.

    The job uses ThreadPooltaskExecutor which could possibly throw RejectedExecutionException if the queue capacity is full.

    In such cases, I want the thread to sleep for some time and retry after some time. Also to see that the job has not stopped if this exception is thrwon.

    How should I do this while executing from the tasklet?

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    I'm curious about what your use case is? It seems to me you're using a TaskletStep, when using the full fledged ItemOrientedStep is what you really want. If you look at say the, SkipLimitStepFactoryBean, it allows you to configure retry or skip policies for any exceptions it encounters. This prevents you from needing to deal with ExceptionHandlers, etc.

Posting Permissions

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