Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShouldDrop = errors.New("unprocessed message")
ErrShouldDrop 如果接收到的消息 consumer 无法处理,希望从队列中删除, 需要返回这个错误
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
MQConsumer mq consumer 对象
type ConsumerWorker ¶
ConsumerWorker 处理从 MQ 得到的消息
type ExchangeKind ¶
type ExchangeKind string
const ( ExchangeTopic ExchangeKind = amqp.ExchangeTopic ExchangeTFanout ExchangeKind = amqp.ExchangeFanout ExchangeTDirect ExchangeKind = amqp.ExchangeDirect ExchangeTHeaders ExchangeKind = amqp.ExchangeHeaders )
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func (*Producer) PurgeQueue ¶ added in v0.0.9
PurgeQueue will purge all undelivered message of queue which declare in Config struct
type RabbitMqConsumer ¶
type RabbitMqConsumer interface { Start() Stop() }
func NewConsumer ¶
func NewConsumer(ctx context.Context, worker ConsumerWorker, config *Config) RabbitMqConsumer
NewConsumer 创建一个 MQConsumer 实例
type RabbitMqProducer ¶
func NewMqProducer ¶
func NewMqProducer(config *Config) (RabbitMqProducer, error)
Click to show internal directories.
Click to hide internal directories.