Package com.yahoo.messagebus.routing
Class Resender
java.lang.Object
com.yahoo.messagebus.routing.Resender
The resender handles scheduling and execution of sending instances of
RoutingNode
. An instance of this class
is owned by MessageBus
. Because this class does not have any internal thread, it depends
on message bus to keep polling it whenever it has time.- Author:
- Simon Thoresen Hult
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canRetry
(int errorCode) Returns whether or not the currentRetryPolicy
supports resending aReply
that contains an error with the given error code.void
destroy()
Discards all the routing nodes currently scheduled for resending.void
InvokesRoutingNode.send()
on all routing nodes that are applicable for sending at the current time.
-
Constructor Details
-
Resender
Constructs a new resender.- Parameters:
retryPolicy
- The retry policy to use.
-
-
Method Details
-
canRetry
public boolean canRetry(int errorCode) Returns whether or not the currentRetryPolicy
supports resending aReply
that contains an error with the given error code.- Parameters:
errorCode
- The code to check.- Returns:
- True if the message can be resent.
-
resendScheduled
public void resendScheduled()InvokesRoutingNode.send()
on all routing nodes that are applicable for sending at the current time. -
destroy
public void destroy()Discards all the routing nodes currently scheduled for resending.
-