Announcement Announcement Module
Collapse
No announcement yet.
How to get item from RetryListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get item from RetryListener

    Hi,
    1. Could anybody please tell me how to get current processing item in the RetryListener? Actually, RetryListener will call the interface by passing RetryContext, however, it is not easy to get the current processing item from it.

    2. Also, I noticed that Spring Batch does not have an interface like RetryPolicy.handleRetryExhausted, it will give a chance to RetryListener when RetryTemplate is trying to give up an item that has reached Retry Limit number. I think it is very useful since people does not want to skip a item without recording it. Could we add this interface in RetryListener?

  • #2
    We don't make the item available to retry listeners. But when the retry limit is reached you will still be in a transaction that is going to roll back, so business processing at that point is a bad plan anyway. It is better to use the ItemRecoverer to handle business logic on an exhausted retry because it is guaranteed to be called in a fresh transaction. Does that work for you?

    Comment


    • #3
      Hi Dave,
      thanks you for your reply. I have tried the ItemRecoverer, it is very good. thanks.

      Comment

      Working...
      X