Documentation
¶
Index ¶
- Constants
- func MqStart() (err error)
- func ReceiveMsg(queueExchange QueueExchange, receiver Receiver, otherParams ...int) (err error)
- func Recv2(mq RabbitMQ, receiver Receiver, taskQuit chan<- struct{})
- func Send(queueExchange QueueExchange, msg interface{}) (err error)
- type MapChild
- type MapTest
- type QueueExchange
- type RabbitMQ
- func (r *RabbitMQ) CloseMqChannel() (err error)
- func (r *RabbitMQ) CloseMqConnect() (err error)
- func (r *RabbitMQ) MqConnect() (err error)
- func (r *RabbitMQ) MqOpenChannel() (err error)
- func (mq *RabbitMQ) SendDelayMsg(body string, ttl int64) (err error)
- func (mq *RabbitMQ) SendMsg(body interface{}) (err error)
- func (mq *RabbitMQ) SendRetryMsg(body string, retry_nums int32, args ...string)
- type Receiver
- type TestReceive
Constants ¶
View Source
const ( InitialTimeout = 5 // 默认失败重新间隔/s DefaultExchangeName = "default.change" // 默认交换机 DefaultExchangeType = "direct" // 默认交换类型 )
Variables ¶
This section is empty.
Functions ¶
func ReceiveMsg ¶
func ReceiveMsg(queueExchange QueueExchange, receiver Receiver, otherParams ...int) (err error)
ReceiveMsg 接收消息,连接失败后进行重试
func Send ¶ added in v1.0.8
func Send(queueExchange QueueExchange, msg interface{}) (err error)
Send 发送消息
Types ¶
type QueueExchange ¶
type QueueExchange struct { QuName string // 队列名称 RtKey string // key值 ExName string // 交换机名称 ExType string // 交换机类型 Dns string //链接地址 }
QueueExchange 定义队列交换机对象,外部可调用
type RabbitMQ ¶
type RabbitMQ struct { Channel *amqp.Channel QueueName string // 队列名称 RoutingKey string // key名称 ExchangeName string // 交换机名称 ExchangeType string // 交换机类型 // contains filtered or unexported fields }
RabbitMQ 定义RabbitMQ对象
var StartQueue *RabbitMQ
func (*RabbitMQ) CloseMqChannel ¶
CloseMqChannel 关闭rabbitMQ信道
func (*RabbitMQ) CloseMqConnect ¶
CloseMqConnect 关闭mq链接
func (*RabbitMQ) MqOpenChannel ¶
MqOpenChannel 获取信道给 RabbitMQ
func (*RabbitMQ) SendDelayMsg ¶ added in v1.0.8
SendDelayMsg 生产者发送延时消息
type TestReceive ¶
type TestReceive struct { }
func (*TestReceive) Consumer ¶
func (t *TestReceive) Consumer(byte []byte) error
func (*TestReceive) FailAction ¶
func (t *TestReceive) FailAction(err error, byte []byte) error
Click to show internal directories.
Click to hide internal directories.