Documentation
¶
Index ¶
- Constants
- func ConnectMq(url string) (conn *amqp.Connection, channel *amqp.Channel, err error)
- func NewExclusiveMqConsumer(url, exchange, queue, rkey, ctag string, ack, durable bool) (conn *amqp.Connection, channel *amqp.Channel, deliveries <-chan amqp.Delivery, ...)
- func NewMqConsumer(url, exchange, queue, rkey, ctag string, ack, durable bool) (conn *amqp.Connection, channel *amqp.Channel, deliveries <-chan amqp.Delivery, ...)
- func NewMqExchange(channel *amqp.Channel, name, _type string, durable bool) error
- func NewMqQueue(channel *amqp.Channel, exchange, queue, rkey string, durable, exclusive bool) error
- func PriorityPublish(channel *amqp.Channel, exchange, rkey string, savedisk, priority uint8, ...) error
- func Publish(channel *amqp.Channel, exchange, rkey string, msg []byte) error
Constants ¶
View Source
const ( Transient uint8 = 1 //暂存的消息 Persistent uint8 = 2 //消息持久化 //消息优先级 PriorityMax uint8 = 9 PriorityMin uint8 = 0 )
Variables ¶
This section is empty.
Functions ¶
func NewExclusiveMqConsumer ¶
func NewExclusiveMqConsumer(url, exchange, queue, rkey, ctag string, ack, durable bool) ( conn *amqp.Connection, channel *amqp.Channel, deliveries <-chan amqp.Delivery, err error)
NewExclusiveMqConsumer new a exclusive mq consumer
func NewMqConsumer ¶
func NewMqConsumer(url, exchange, queue, rkey, ctag string, ack, durable bool) ( conn *amqp.Connection, channel *amqp.Channel, deliveries <-chan amqp.Delivery, err error)
NewMqConsumer make a msg consumer创建一个消费者
func NewMqExchange ¶
NewMqExchange New a Exchange _type: 四种exchange类型:direct, topic, headers, fanout
fanout类型的exchange很简单,顾名思义:它将所接收到的消息广播给所有绑定的队列
func NewMqQueue ¶
NewMqQueue declare a queue 声明一个队列,可以指定exchange,routing key durable 消息是否持久化
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.