consumer

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package consumer is the generic consumer-side processing logic for the four modes direct, topic, fanout, headers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumeOption

type ConsumeOption func(*consumeOptions)

ConsumeOption consume option.

func WithConsumeArgs

func WithConsumeArgs(args map[string]interface{}) ConsumeOption

WithConsumeArgs set consume args option.

func WithConsumeAutoAck

func WithConsumeAutoAck(enable bool) ConsumeOption

WithConsumeAutoAck set consume auto ack option.

func WithConsumeConsumer

func WithConsumeConsumer(consumer string) ConsumeOption

WithConsumeConsumer set consume consumer option.

func WithConsumeExclusive

func WithConsumeExclusive(enable bool) ConsumeOption

WithConsumeExclusive set consume exclusive option.

func WithConsumeNoLocal

func WithConsumeNoLocal(enable bool) ConsumeOption

WithConsumeNoLocal set consume noLocal option.

func WithConsumeNoWait

func WithConsumeNoWait(enable bool) ConsumeOption

WithConsumeNoWait set consume no wait option.

func WithConsumeQos

func WithConsumeQos(opts ...QosOption) ConsumeOption

WithConsumeQos set consume qos option.

type Handler

type Handler func(ctx context.Context, data []byte, tagID ...string) error

Handler message

type QosOption

type QosOption func(*qosOptions)

QosOption qos option.

func WithQosPrefetchCount

func WithQosPrefetchCount(count int) QosOption

WithQosPrefetchCount set qos prefetch count option.

func WithQosPrefetchGlobal

func WithQosPrefetchGlobal(enable bool) QosOption

WithQosPrefetchGlobal set qos global option.

func WithQosPrefetchSize

func WithQosPrefetchSize(size int) QosOption

WithQosPrefetchSize set qos prefetch size option.

type Queue

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

Queue session

func NewQueue

func NewQueue(ctx context.Context, name string, c *rabbitmq.Connection, opts ...ConsumeOption) (*Queue, error)

NewQueue create a queue

func (*Queue) Close

func (q *Queue) Close()

Close queue

func (*Queue) Consume

func (q *Queue) Consume(handler Handler)

Consume messages for loop in goroutine

Jump to

Keyboard shortcuts

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