rabbitmq

package
v1.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueTypeDL      = "dlq"
	QueueTypeInstant = "instant"
	QueueTypeDelay   = "delay"
)
View Source
const KeyRetryCount = "rabbitmqAutoRetryCount"

Variables

View Source
var ErrCleanShutdown = errors.New("clean shutdown of rabbitmq streams")
View Source
var ErrPublisherNotInit = errors.New("auto retry publish error: publisher not initialized, please call the InitPublisher method")

Functions

func GetRetryCount added in v1.6.1

func GetRetryCount(e *ziggurat.Event) int

Types

type ARetry added in v1.4.5

type ARetry struct {
	// contains filtered or unexported fields
}

func AutoRetry

func AutoRetry(qc Queues, opts ...Opts) *ARetry

func (*ARetry) DSReplayHandler added in v1.4.5

func (r *ARetry) DSReplayHandler(ctx context.Context) http.Handler

func (*ARetry) DSViewHandler added in v1.4.5

func (r *ARetry) DSViewHandler(ctx context.Context) http.Handler

DSViewHandler allows you to peek into

the rabbitMQ dead-set queue.

func (*ARetry) DeleteQueuesAndExchanges added in v1.4.5

func (r *ARetry) DeleteQueuesAndExchanges(ctx context.Context, queueName string) error

func (*ARetry) InitPublishers added in v1.4.5

func (r *ARetry) InitPublishers(ctx context.Context) error

func (*ARetry) Publish added in v1.4.5

func (r *ARetry) Publish(ctx context.Context, event *ziggurat.Event, queueKey string, queueType string, expirationMS string) error

Publish can be called from anywhere and messages can be sent to any queue

func (*ARetry) Retry added in v1.6.1

func (r *ARetry) Retry(ctx context.Context, event *ziggurat.Event, queueKey string) error

func (*ARetry) Stream added in v1.4.5

func (r *ARetry) Stream(ctx context.Context, h ziggurat.Handler) error

func (*ARetry) Wrap added in v1.4.5

func (r *ARetry) Wrap(f ziggurat.HandlerFunc, queueKey string) ziggurat.HandlerFunc

type Opts

type Opts func(r *ARetry)

func WithConnectionTimeout added in v1.4.0

func WithConnectionTimeout(t time.Duration) Opts

func WithHosts

func WithHosts(hosts ...string) Opts

func WithLogger

func WithLogger(l ziggurat.StructuredLogger) Opts

func WithPassword

func WithPassword(password string) Opts

func WithUsername

func WithUsername(username string) Opts

type QueueConfig

type QueueConfig struct {
	QueueKey              string
	DelayExpirationInMS   string
	RetryCount            int
	ConsumerPrefetchCount int
	ConsumerCount         int
}

type Queues added in v1.4.0

type Queues []QueueConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL