Commit Graph

115 Commits

Author SHA1 Message Date
Gary Russell
2e293c33c3 Set RetryState Key to null if Necessary
See 9a95da2b70

If the key generator returns null, we need to set the key to null so the
state is not stored.
2016-09-26 10:05:31 +01:00
Dave Syer
18705bd905 Add convenience constructor to SimpleRetryPolicy 2016-09-26 10:04:08 +01:00
Dave Syer
48935e745e Clarify contract of context cache 2016-09-23 16:12:59 +01:00
Dave Syer
9a95da2b70 If retry state key is null, context is not cached
If the retry state has a null key it could be an error, but there
are real work scenarios where that just means "no information"
and the safest thing to do in that case is to simply not cache the
retry context (so the retry callback is executed "naturally" and
the exception bubbles up).

See comment in gh-49 about Spring AMQP use case
2016-09-23 16:08:56 +01:00
Dave Syer
6599311bb9 Merge branch '1.1.x'
Conflicts:
	pom.xml
2016-09-20 14:16:08 +01:00
Gary Russell
ce3621ea1d Find @Retryable on Target Class
fixes #32
2016-09-20 14:13:58 +01:00
Gary Russell
660c01adc9 GH-19 SimpleRetryPolicy MaxAttempts JavaDocs
See GH-19
2016-09-20 14:13:53 +01:00
Dave Syer
54f667f5be Chasing test coverage 2016-08-24 15:57:53 +01:00
Dave Syer
7aedbefc48 Extract constants and fix spelling error in their value 2016-08-24 15:07:04 +01:00
Dave Syer
0afcf3965d Add support for rolling averages and attributes in RetryStatistics
Using these you can get a pretty decent (if basic) hystrix-compatible
metrics stream. The "open" state of the circuit is exposed as
a RetryContext attribute for that purpose.
2016-08-24 10:32:41 +01:00
Dave Syer
9834a08020 Switch defaults of open and reset timeouts 2016-08-23 17:19:07 +01:00
Dave Syer
6c4d279546 Ensure label is used if available in stateful retry interceptor 2016-08-23 15:36:22 +01:00
Dave Syer
e99c32d40c Always cache the context if it is global
Circuit breakers, for instance, would like to store some state
for the duration of the lifetime of the circuit. So the normal
rule that the cache is not used until there is an error doesn't
make as much sense.
2016-08-23 15:07:18 +01:00
Dave Syer
38316963c1 Ensure label is only set if explicit 2016-08-23 13:31:00 +01:00
Dave Syer
411d47d7b2 Change the strategy for key generation in stateful retry
There were a couple of issues to fix here. The first was that only
the method arguments and not the method signature (or label) were
being used in the key generator. Plus the arguments were being
used as an array, which has a different hashcode on each invocation
(a Collection would be better). Plus the interceptor builder
didn't set the key generator in a circuit breaker, so all the method
calls with different args are unique and they are supposed to be the
same.

See gh-49
2016-08-23 12:29:48 +01:00
Dave Syer
08cb981f58 Add test for @CircuitBreaker and statistics 2016-08-23 11:45:20 +01:00
Dave Syer
a256349954 Add support for label in @Retryable
and test for it in RetryOperationsInterceptor
2016-08-23 11:21:28 +01:00
Dave Syer
f3e1c4675d Check for null listeners 2016-08-23 11:00:26 +01:00
Dave Syer
5a70f99738 Line endings 2016-08-23 10:57:56 +01:00
Dave Syer
730d93038c Ensure label is used in StatefulRetryOperationsInterceptor 2016-08-23 10:57:56 +01:00
Dave Syer
1cb4f19cf1 Add support for RetryListener beans in @EnableRetry 2016-08-23 10:57:56 +01:00
Dave Syer
cc97238158 Consolidate calls to parent.open() 2016-08-23 10:57:56 +01:00
Dave Syer
f47584812b Basic integration between statistics and circuit breaker
Really just a check that the existing metrics make sense. Next
step is to provide statistics for each circuit including
information on circuit status and timeouts.
2016-08-23 10:57:56 +01:00
Dave Syer
9af84c086d Initial working draft of circuit breaker retry policy
User can manually configure a CircuitBreakerRetryPolicy
but needs to be careful to use stateful retry and
a RetryState where rollbackFor() is always false so that the
recovery is applied.

Better (probably) is to use @CircuitBreaker.
2016-08-23 10:57:56 +01:00
Gary Russell
51523c0b40 Find @Retryable on Target Class
fixes #32
2016-08-23 10:56:03 +01:00
Gary Russell
5e31f49e07 GH-19 SimpleRetryPolicy MaxAttempts JavaDocs
See GH-19
2016-08-23 10:52:04 +01:00
Dave Syer
4f00bb60d8 Add example of @Recover with args 2016-08-23 10:43:46 +01:00
Dave Syer
c8f2d07adb Clarify rethrowing of original exception in RetryTemplate 2016-08-23 10:38:12 +01:00
Dave Syer
7be8f1789e Add contributing section and link to CLA 2016-08-23 10:19:28 +01:00
Dave Syer
48835d7a3c Fix package name in README 2016-08-23 10:15:08 +01:00
Dave Syer
b5340eb450 Revert to snapshots 2016-06-21 12:34:23 +01:00
Dave Syer
6b2b20a814 Update for 1.1.3 2016-06-21 12:33:52 +01:00
Dave Syer
6c2cc11264 Add statistics support via a listener 2016-06-21 12:29:37 +01:00
Dave Syer
8fcd854365 Add a label to RetryContext 2016-06-21 12:29:37 +01:00
Dave Syer
2d821f46de Update to 1.2.0 2016-06-21 12:28:28 +01:00
Dave Syer
419f16274a Rethrow original exception even if exhausted only
There doesn't seem to be much justification for throwing
RetryExhaustedException unconditionally when the context
is marked as exhausted. It would be better to behave,
as far as the caller is concerned, as if the cause had
been the original exception.
2016-04-12 07:24:22 -04:00
Josh Long
8c247151c9 support private @Recover methods 2016-02-12 17:50:20 +00:00
Josh Long
004d277c81 javadoc 2016-02-12 17:12:40 +01:00
Dave Syer
cacf5d25db Fix another typo 2016-02-10 09:38:23 +00:00
Dave Syer
c1ad693825 Tidy up some javadocs 2016-02-10 09:34:21 +00:00
Gary Russell
d0ac53c76e Add Code of Conduct 2016-02-03 09:58:36 -05:00
Dave Syer
c2c3acbf6b Add javadocs report 2014-11-11 22:09:18 +00:00
Dave Syer
162c4167ce Add wagon provider for ssh 2014-11-11 22:09:13 +00:00
Dave Syer
ea9011643c [maven-release-plugin] prepare for next development iteration 2014-09-30 13:17:32 +01:00
Dave Syer
80871bce11 [maven-release-plugin] prepare release 1.1.2 2014-09-30 13:17:25 +01:00
Dave Syer
55839cefbb Widen Pointcut for @Retryable to cover multiple methods on same class
Fixes gh-15
2014-09-19 10:24:54 +01:00
Dave Syer
ff27754e74 Remove unused local variable 2014-09-19 09:33:52 +01:00
Dave Syer
b866155ffb Tidy up dependencies (spring-context is now optional) 2014-09-19 09:33:40 +01:00
Dave Syer
e2bee41f02 Spelling mistake 2014-09-19 09:22:35 +01:00
Dave Syer
155ea0c2df [maven-release-plugin] prepare for next development iteration 2014-08-28 13:51:11 +01:00