History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BATCH-374
Type: Task Task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Lucas Ward
Reporter: Gaetan Pitteloud
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

Add configuration points for backoff policy and retry listeners in StatefulRetryStepFactoryBean

Created: 20/Feb/08 04:51 AM   Updated: 08/Mar/08 06:15 AM
Component/s: Execution
Affects Version/s: 1.0.0.m4
Fix Version/s: 1.0.0.rc1

Time Tracking:
Original Estimate: 0.12d
Original Estimate - 0.12d
Remaining Estimate: 0.12d
Remaining Estimate - 0.12d
Time Spent: Not Specified
Remaining Estimate - 0.12d


 Description  « Hide
The RetryTemplate cannot be configured in ItemOrientedTasklet: cannot set a backoffPolicy or interceptors, as it is private without getter/setter.

The easiest way is to simply provide a getter for RetryTemplate, so that we can configure it the following way:

<bean id="tasklet" class="ItemOrientedTasklet">
  <property name="retryTemplate.backOffPolicy" ref="..." />
  <property name="retryTemplate.interceptor" ref="..." />
</bean>

The more extensible approach would be to provide a setter too, in case we want to replace the retry template too, with the default being a simple RetryTemplate. Further, the instance type should be RetryOperations instead of RetryTemplate.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Dave Syer - 21/Feb/08 01:33 AM
ItemOrientedTasklet no longer exists (m4 was the last sighting). But it always had a subclass (RestartableItemOrientedTasklet I think it was) that had a RetryPolicy as an injectable dependency. The equivalent functionality now exists in the Step implementations.

Lucas is in charge of making sure that the equivalent functionality survives to m5, so I'm assigning this to him (but probably it is going to be a "Won't Fix").

N.B. as a rule we never put getters in the public API. I actually like your example for its deviousness, but it breaks the rule of thumb we have across the whole Spring portfolio about encapsulation.

Dave Syer - 08/Mar/08 06:15 AM
BackoffPolicy and RetryListeners added in rc1.