Documentation
¶
Overview ¶
Package retry provides retry policies for failed message processing in consumers.
Index ¶
Constants ¶
View Source
const (
// Forever represents unlimited retry attempts.
Forever = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct {
// Retries is a list of retry steps to attempt.
Retries []Retry
// FinallyMoveToDlq specifies whether to move the message to DLQ after all retries are exhausted.
FinallyMoveToDlq bool
}
Policy defines a complete retry configuration with multiple retry steps.
type Publisher ¶
type Publisher interface {
PublishWithConfirmation(ctx context.Context, exchange string, routingKey string, msg *amqp.Publishing) error
}
Publisher defines an interface for publishing messages with confirmation.
type Retry ¶
Retry defines a single retry step with a delay and maximum attempt count.
func ForeverWithDelay ¶
ForeverWithDelay creates a retry step that retries indefinitely with the specified delay.
type Retryer ¶
type Retryer struct {
// contains filtered or unexported fields
}
Retryer manages message retry logic according to a configured policy.
func NewRetryer ¶
NewRetryer creates a new Retryer with the specified configuration.
Click to show internal directories.
Click to hide internal directories.