Documentation ¶
Index ¶
Constants ¶
View Source
const ( ReconnectDelay = 10 // 连接断开后多久重连 ResendDelay = 3 // 消息发送超时时间 )
Variables ¶
View Source
var ( ParamsError = errors.New("地址、路由和队列不能为空") CallBackError = errors.New("消费回调函数不能为空") )
Functions ¶
This section is empty.
Types ¶
type RbMqClient ¶
type RbMqClient struct {
// contains filtered or unexported fields
}
func NewAndInitRabbitClient ¶
NewAndInitRabbitClient 新建消费端(消费消息)
func NewAndInitRabbitServer ¶
func NewAndInitRabbitServer(rbInfo RbInfo) (*RbMqClient, error)
NewAndInitRabbitServer 新建服务端(发布消息)
func NewRabbitProduct ¶
func (*RbMqClient) Consume ¶
func (rabbitProduct *RbMqClient) Consume(prefetchCount int)
Consume 消费消息 prefetchCount 预取数量,设置为1的话,可以实现性能高的服务器消费的数量多
func (*RbMqClient) InitRabbitProduct ¶
func (rabbitProduct *RbMqClient) InitRabbitProduct()
func (*RbMqClient) PublishMulti ¶
func (rabbitProduct *RbMqClient) PublishMulti(msgs [][]byte) (bool, int)
PublishMulti 返回发送是否全部成功和发送成功的数量
Click to show internal directories.
Click to hide internal directories.