Package com.yahoo.messagebus.routing
Interface RetryPolicy
-
- All Known Implementing Classes:
RetryTransientErrorsPolicy
public interface RetryPolicy
When aReply
containing errors is returned to aMessageBus
, an object implementing this interface is consulted on whether or not to resend the correspondingMessage
. The policy is passed to the message bus at creation time using theMessageBusParams.setRetryPolicy(RetryPolicy)
method.- Author:
- Simon Thoresen Hult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canRetry(int errorCode)
double
getRetryDelay(int retry)
Returns the number of seconds to delay resending a message.
-
-
-
Method Detail
-
canRetry
boolean canRetry(int errorCode)
Returns whether or not aReply
containing anError
with the given error code can be retried. This method is invoked once for each error in a reply.- Parameters:
errorCode
- The code to check.- Returns:
- True if the message can be resent.
-
getRetryDelay
double getRetryDelay(int retry)
Returns the number of seconds to delay resending a message.- Parameters:
retry
- The retry attempt.- Returns:
- The delay in seconds.
-
-