Commit Graph

56 Commits

Author SHA1 Message Date
Artem Bilan
1a54a3e1c2 Code Cleanup
* Deprecate `ObjectWaitSleeper` and replace it with `ThreadWaitSleeper`
* Improve `SimpleMethodInvoker`
* Use `if (logger.isDebugEnabled())` for better performance

The `RetryTemplate` continues to invoke `canRetry(retryPolicy, context)` with retry loop, because some end application may rely on that logic.
Although it looks like overhead to call `canRetry()` twice a retry: it might be heavy operation, e.g. check the state of external system

Fixes gh-10
2014-05-12 17:05:58 +01:00
Dave Syer
6b69ad901b Add proxyTargetClass attribute to @EnableRetry 2014-05-07 05:49:43 -07:00
Dave Syer
bccdaad2b7 Tidy up @Retryable
* Add some docs to backoff()
* Remove unnecessary @Import
2014-05-07 02:38:41 -07:00
Dave Syer
806b380eb6 [maven-release-plugin] prepare for next development iteration 2014-05-03 07:34:13 +01:00
Dave Syer
3c36be54fb [maven-release-plugin] prepare release 1.1.0.RC2 2014-05-03 07:34:08 +01:00
Dave Syer
31ce602c14 Switch back to Java 1.6 2014-05-03 07:33:30 +01:00
Dave Syer
e3f12e1a71 [maven-release-plugin] prepare for next development iteration 2014-04-25 16:54:41 +01:00
Dave Syer
0076eb5b95 [maven-release-plugin] prepare release 1.1.0.RC1 2014-04-25 16:54:36 +01:00
Dave Syer
fa36d64b41 Fix pom for release 2014-04-25 16:53:29 +01:00
Dave Syer
2abfcef18c Add Retryable interface for proxies advising @Retryable beans
This is purely a marker interface, but might be useful for other tools
looking to apply retry advice (they should usually not bother if the
bean already implements Retryable)
2014-04-24 14:17:12 +01:00
Dave Syer
5fc484df58 Parameterize exception type in RetryCallback
So RetryCallback<T, E extends Throwable> and the E parameter appears
in RetryOperations too, making it possible to call it with an unchecked
exception type in the parameter and not catch exceptions.

Users should beware: it's just syntactic sugar, and the actual runtime
type of the exception is never checked at runtime. So, for instance,
declaring a RetryCallback<Object,IllegalArgumentException> doesn't
mean that other Exceptions won't be retried, just that you won't be
able to explicitly throw them if they are checked.

A project using Spring Batch 2.2 was used to test that this works
with user code that uses a library compiled agains Spring Retry 1.0.

Fixes gh-6
2014-04-24 12:18:32 +01:00
Dave Syer
9fb92bccbd Add support for @Recover 2014-04-24 09:41:26 +01:00
Dave Syer
46c3ebde4e Remove OSGi template.mf 2014-04-23 16:22:25 +01:00
Dave Syer
9e2c23e795 Add README from Spring Batch docs 2014-04-23 16:21:11 +01:00
Dave Syer
dab8602a0e Change method signatures to Throwable (from Exception)
This allows use of spring-retry with naughty libraries that use Error
conditions to signal retryable exceptions. Users can still declare their
RetryCallback as "throws Exception" if they want to be conservative.

Also added throwLastExceptionOnExhausted to RetryTemplate to throw
the last exception instead of the ExhaustedRetryException.
2014-04-22 16:55:14 +01:00
Dave Syer
40e7777428 Fix copyrights 2014-04-22 16:29:40 +01:00
Dave Syer
705eabcbf8 Add @EnableRetry support (like @Async) 2014-04-22 16:25:38 +01:00
Dave Syer
06f766a43f Merge pull request #9 from msrb/add_license_text
Add ASL 2.0 license text
2014-01-09 05:54:58 -08:00
Dave Syer
68b9a0fe8a [maven-release-plugin] prepare for next development iteration 2013-10-16 12:34:20 -04:00
Dave Syer
0c420157d0 [maven-release-plugin] prepare release 1.0.3.RELEASE 2013-10-16 12:34:18 -04:00
Michal Srb
697219ae47 Add ASL 2.0 license text 2013-10-16 10:37:25 +02:00
Gary Russell
aad050ba47 AMQP-334 Fix Nested Cause Classification
Consider Foo caused by Bar caused by Baz.

If Bar is categorized TRUE and Baz categorized FALSE, classiy() should
return TRUE (hit on Bar), but it returned FALSE.

The early exit from the cause traversal was not taken because we
were always testing against the top level throwable (Bar).

Add a test to verify this scenario; test against the cause on
each iteration through the loop.
2013-10-02 11:21:22 -04:00
Gary Russell
6396f11878 AMQP-334 Support Unwrapping Exceptions for Retry
With Spring AMQP, the exception thrown to the
RetryTemplate is a ListenerExecutionFailedException
with the business exception in the cause. This means
Exception categorization does not work.

Provide a retry policy/classifier that can examine
exception causes until a match is found.

If so configured, the retry policy should categorize
exceptions by traversing the cause if the current
exception is not itself categorized.
2013-09-28 09:21:48 -04:00
Dave Syer
d9ee15606e Remove JUnit TestCase references 2013-04-05 14:35:06 +01:00
Dave Syer
e9fa48236f Make ExponentialRandomBackOffPolicy more random
The old version was still very prone to multiple threads marching
in lock step.  It is better to use random backoffs (with some
exponential growth).
2012-12-18 13:22:51 +00:00
Gunnar Hillert
907bba3c2c Merge pull request #5 from mminella/BATCH-1718
# By Michael Minella
* mminella-BATCH-1718:
  BATCH-1718: Added optimistic flag
2012-10-03 10:03:15 -04:00
Michael Minella
35fd6e2826 BATCH-1718: Added optimistic flag 2012-10-03 10:00:33 -04:00
Dave Syer
2875065d7c [maven-release-plugin] prepare for next development iteration 2012-06-18 10:26:24 +01:00
Dave Syer
30c2b6d218 [maven-release-plugin] prepare release 1.0.2.RELEASE 2012-06-18 10:26:24 +01:00
Dave Syer
dbabb7cd52 Fix pom for mvn release 2012-06-18 10:25:40 +01:00
Jon Travis
cba64c046f Add the SpringSource Maven repository used for the Bundlor plugin 2012-05-29 18:16:25 -04:00
Jon Travis
759d40ed5d Add the ExponentialRandomBackOffPolicy
- Gives better performance when run in a very
    contentious environment.  Specifically when
    running multi-threaded tests where all threads
	may start at the same time.
2012-05-29 09:31:48 +01:00
Jon Travis
9eebfe2288 Added RetrySimulator - simulate retry + backoff loops
- The RetrySimulator can be used to calibrate
    retry + backoff tuples.
2012-05-29 09:31:48 +01:00
Gary Russell
048e3dec35 Fix Staging Directory in POM.
Pointed to amqp staging dir.
2012-05-15 14:48:15 -04:00
Gary Russell
160b84ce22 [maven-release-plugin] prepare for next development iteration 2012-05-10 13:57:11 -04:00
Gary Russell
688145adb6 [maven-release-plugin] prepare release 1.0.1.RELEASE 2012-05-10 13:57:08 -04:00
Oleg Zhurakousky
3b49892d94 Merge pull request #1 from garyrussell/AMQP-226
* AMQP-226:
  AMQP-226 Fix Exponential Back Off
2012-05-10 10:12:27 -04:00
Gary Russell
c53f1f09d1 AMQP-226 Fix Exponential Back Off
Previously, for stateful environments,the
multiplier had no effect and the backoff
policy always slept for the initial interval.

AMQP-226 Polishing

Using AttributeAccessor interface instead of concrete
RetryContextSupport.
2012-05-10 10:11:07 -04:00
Dave Syer
c36d1f651a Fix metadata for deployment 2011-07-22 09:48:47 +01:00
Dave Syer
1dd2c050b6 [maven-release-plugin] prepare for next development iteration 2011-07-22 08:33:44 +01:00
Dave Syer
b331232f9d [maven-release-plugin] prepare release 1.0.0.RELEASE 2011-07-22 08:33:30 +01:00
Dave Syer
ee8c240ff2 Prepare for release 2011-07-22 08:32:30 +01:00
Dave Syer
df8941eb60 Use concurrent map in classifier 2011-04-05 11:57:50 +01:00
Dave Syer
fb198b7e7a [maven-release-plugin] prepare for next development iteration 2011-03-31 13:18:52 +01:00
Dave Syer
fbfef25f9c [maven-release-plugin] prepare release 1.0.0.RC2 2011-03-31 13:18:41 +01:00
Dave Syer
fbfc0b5c6b Add optional recovery callback for stateless retry interceptor 2011-03-25 16:21:49 +00:00
Dave Syer
a97db67845 Supress serialization warnings 2011-03-25 12:44:41 +00:00
Dave Syer
4bd297691e Prevent infinite loop if retry policy fails 2011-03-25 12:44:25 +00:00
Dave Syer
9b37d4da8d Change groupId to org.springframework.retry 2011-03-14 12:15:58 +00:00
Dave Syer
02437dc4c1 Add s3 extension for upload 2011-03-10 17:04:24 +00:00