mq

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessage

func NewMessage(topic string, data []byte) *primitive.Message

Types

type Consumer

type Consumer interface {
	rocketmq.PushConsumer
}

Consumer defines mq push consumer

func NewConsumer

func NewConsumer(cfg *ConsumerConfig) (Consumer, error)

type ConsumerConfig

type ConsumerConfig struct {
	Addr        []string
	Subscriber  Subscriber
	Concurrence int
}

type Producer

type Producer interface {
	rocketmq.Producer
}

Producer defines mq message producer

func NewProducer

func NewProducer(cfg *ProducerConfig) (Producer, error)

type ProducerConfig

type ProducerConfig struct {
	Retry int
	Addr  []string
}

type SubscribeCallback

type SubscribeCallback func(context.Context, ...*primitive.MessageExt) (consumer.ConsumeResult, error)

type Subscriber

type Subscriber interface {
	Group() string
	Topic() string
	Consume(context.Context, ...*primitive.MessageExt) (consumer.ConsumeResult, error)
}

Jump to

Keyboard shortcuts

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