Package com.yahoo.messagebus.routing
Class Resender
- java.lang.Object
-
- com.yahoo.messagebus.routing.Resender
-
public class Resender extends java.lang.Object
The resender handles scheduling and execution of sending instances ofRoutingNode
. An instance of this class is owned byMessageBus
. 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
Constructors Constructor Description Resender(RetryPolicy retryPolicy)
Constructs a new resender.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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
resendScheduled()
InvokesRoutingNode.send()
on all routing nodes that are applicable for sending at the current time.
-
-
-
Constructor Detail
-
Resender
public Resender(RetryPolicy retryPolicy)
Constructs a new resender.- Parameters:
retryPolicy
- The retry policy to use.
-
-
Method Detail
-
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.
-
-