Documentation ¶
Index ¶
- type MQMessage
- type MqCustomer
- type MqProducer
- func (mq *MqProducer) SendAsyncMessage(msg *MQMessage, ...) (bool, error)
- func (mq *MqProducer) SendAsyncMessageBody(msg *MQMessage) (bool, error)
- func (mq *MqProducer) SendSyncMessage(msg *MQMessage) (bool, error)
- func (mq *MqProducer) SendSyncbatchMessage(msgs []*MQMessage) (bool, error)
- func (mq *MqProducer) Shutdown() error
- type RockerMQAdmin
- type SendMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MqCustomer ¶
type MqCustomer struct { QueuePull primitive.MessageQueue MessageList chan *primitive.MessageExt // contains filtered or unexported fields }
func NewPushCustomer ¶
func NewPushCustomer(groupName string, NameSrvAddr []string, isBroadCasting bool) *MqCustomer
NewPushCustomer 创建一个MQ消费者
func (*MqCustomer) ShutdownPushConsumer ¶
func (mq *MqCustomer) ShutdownPushConsumer() error
ShutdownPushConsumer 关闭消费者
func (*MqCustomer) Subscribe ¶
func (mq *MqCustomer) Subscribe(topicName, tag string)
Subscribe 订阅者模式
type MqProducer ¶
type MqProducer struct {
// contains filtered or unexported fields
}
func NewMQProducer ¶
func NewMQProducer(topicName, groupName string, NameSrvAddr []string) *MqProducer
NewMQProducer 生产者
func (*MqProducer) SendAsyncMessage ¶
func (mq *MqProducer) SendAsyncMessage(msg *MQMessage, callback func(ctx context.Context, result *primitive.SendResult, err error)) (bool, error)
SendAsyncMessage 发送异步消息后回调
func (*MqProducer) SendAsyncMessageBody ¶
func (mq *MqProducer) SendAsyncMessageBody(msg *MQMessage) (bool, error)
SendAsyncMessageBody 发送异步消息后回调
func (*MqProducer) SendSyncMessage ¶
func (mq *MqProducer) SendSyncMessage(msg *MQMessage) (bool, error)
SendSyncMessage 发送同步消息
func (*MqProducer) SendSyncbatchMessage ¶
func (mq *MqProducer) SendSyncbatchMessage(msgs []*MQMessage) (bool, error)
SendSyncbatchMessage SendSyncMessageList 发送批量消息
type RockerMQAdmin ¶
type RockerMQAdmin struct { NameSrvAddr []string BrokerAddr string Admin admin.Admin Topic string // contains filtered or unexported fields }
func NewMQAdmin ¶
func NewMQAdmin(Topic, BrokerAddr string, nameSrvAddr []string) *RockerMQAdmin
NewMQAdmin 创建MQAdmin
func (*RockerMQAdmin) CloseMQAdmin ¶
func (r *RockerMQAdmin) CloseMQAdmin() error
CloseMQAdmin 关闭MQAdmin
func (*RockerMQAdmin) CreateTopic ¶
func (r *RockerMQAdmin) CreateTopic(TopicName string) error
CreateTopic 创建topic
func (*RockerMQAdmin) DeleteTopic ¶
func (r *RockerMQAdmin) DeleteTopic(TopicName string) error
DeleteTopic 删除topic
type SendMsg ¶
func ConnRockerMQ ¶
func (*SendMsg) DelaySendSync ¶
DelaySendSync // 延迟发送消息 delay send message
func (*SendMsg) SendAsyncBatch ¶
SendAsyncBatch // 批量发送消息
func (*SendMsg) TagSendSync ¶
TagSendSync 发送带有tag的消息
Click to show internal directories.
Click to hide internal directories.