rmqlib

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CommonDelayInit

func CommonDelayInit() error

延迟队列

func CommonFanoutInit

func CommonFanoutInit() error

定义广播

func CommonInit

func CommonInit() error

初始化通用队列

func CommonTopicInit

func CommonTopicInit() error

定义主题

func GetConn

func GetConn() *amqp.Connection

func InitConn

func InitConn(user string, pwd string, host string, port int)

初始化mq连接

Types

type MQ

type MQ struct {
	Channel *amqp.Channel
	// contains filtered or unexported fields
}

func NewMQ

func NewMQ() *MQ

func (*MQ) Consume

func (this *MQ) Consume(queue string, key string, callback func(<-chan amqp.Delivery, string, map[string]interface{}), config map[string]interface{})

消费

func (*MQ) DecQueueAndBind

func (this *MQ) DecQueueAndBind(queues string, key string, exchange string) error

func (*MQ) ListenConfirm

func (this *MQ) ListenConfirm()

cofirm模式的回调处理

func (*MQ) NotifyReturn

func (this *MQ) NotifyReturn()

设置notify模式,侦听消息有没有正确入列

func (*MQ) SendDelayMessage

func (this *MQ) SendDelayMessage(key string, exchange string, message string, delay int) error

* SendDelayMessage 发送延迟消息

func (*MQ) SendFanoutMessage

func (this *MQ) SendFanoutMessage(exchange string, message string) error

func (*MQ) SendMessage

func (this *MQ) SendMessage(key string, exchange string, message string) error

func (*MQ) SetConfirm

func (this *MQ) SetConfirm()

confirm模式,消息有没有正确入交换机

Jump to

Keyboard shortcuts

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