consumer

package
v0.1.36 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerArgs

type ConsumerArgs struct {
	Consumer  string
	QueueName string
	AutoAck   bool
	Exclusive bool
	NoLocal   bool
	NoWait    bool
	Args      amqp091.Table
}

type ConsumerOption

type ConsumerOption func(*ReliableRabbitConsumer)

func WithConsumerArgs

func WithConsumerArgs(args ConsumerArgs) ConsumerOption

func WithDeclaredQueueArgs

func WithDeclaredQueueArgs(args DeclaredQueueArgs) ConsumerOption

func WithExchangeArgs

func WithExchangeArgs(args ExchangeArgs) ConsumerOption

func WithLogger

func WithLogger(l logger.Logger) ConsumerOption

func WithQos

func WithQos(prefetchCount int, global bool) ConsumerOption

type DeclaredQueueArgs

type DeclaredQueueArgs struct {
	Name       string
	Durable    bool
	AutoDelete bool
	Exclusive  bool
	NoWait     bool
	Args       amqp091.Table
}

type ExchangeArgs

type ExchangeArgs struct {
	ExchangeName string
	RoutingKey   string
}

type ReliableRabbitConsumer

type ReliableRabbitConsumer struct {
	URL               string
	ExchangeArgs      ExchangeArgs
	DeclaredQueueArgs DeclaredQueueArgs
	ConsumerArgs      ConsumerArgs
	HandleFunc        func(ctx context.Context, msg amqp091.Delivery) interface{}
	// contains filtered or unexported fields
}

func NewReliableRabbitConsumer

func NewReliableRabbitConsumer(url string, handleFunc func(ctx context.Context, msg amqp091.Delivery) interface{}, opts ...ConsumerOption) *ReliableRabbitConsumer

func (*ReliableRabbitConsumer) Start

func (c *ReliableRabbitConsumer) Start() (err error)

func (*ReliableRabbitConsumer) Stop

func (c *ReliableRabbitConsumer) Stop()

Jump to

Keyboard shortcuts

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