-
Apr 18th, 2008, 04:27 AM
#1
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?
David Yinwei Liu
-
Apr 18th, 2008, 12:02 PM
#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?
-
Apr 19th, 2008, 12:02 AM
#3
Hi Dave,
thanks you for your reply. I have tried the ItemRecoverer, it is very good. thanks.
David Yinwei Liu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules