Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // MaxRetries is maximum number of times a retry will be attempted. MaxRetries int // InitialBackoff is the first interval between retries. Subsequent intervals will be scaled by BackoffFactor. InitialBackoff time.Duration // MaxBackoff sets the limit for the exponential backoff of retries. The interval will not be // increased beyond MaxBackoff. MaxBackoff time.Duration // BackoffFactor is the factor by which the waiting interval will be multiplied between retries. BackoffFactor float64 // MaxMessages is the maximum number of messages that can be concurrently managed by the redelivery service. MaxMessages int }
Config holds the configuration parameters for the redelivery service.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration parameters for the redelivery service.
type Service ¶
Service manages redelivery of messages that failed delivery. The messages are published after a delay which is calculated according to the provided config, which includes an initial backoff and a backoff factor.
func NewService ¶
NewService returns a new redelivery service.
func (*Service) Add ¶
Add adds a message for redelivery. The time when the redelivery attempt will occur is returned, or an error is returned if the message cannot be redelivered. This function generally returns immediately, although if the number of messages already being redelivered has reached the MaxMessages limit then this function will block until a previously added message has been processed.