Documentation ¶
Index ¶
- Variables
- func GetProducer(configName string) (producer rocketmq.Producer, ok bool)
- func GetPushConsumer(configName string) (consumer rocketmq.PushConsumer, ok bool)
- type Consumer
- type ConsumerConfig
- type Producer
- func (p *Producer) Close() error
- func (p *Producer) SendMessageOneway(msg *rocketmq.Message) error
- func (p *Producer) SendMessageOrderly(msg *rocketmq.Message, selector rocketmq.MessageQueueSelector, arg interface{}, ...) (*rocketmq.SendResult, error)
- func (p *Producer) SendMessageOrderlyByShardingKey(msg *rocketmq.Message, shardingkey string) (*rocketmq.SendResult, error)
- func (p *Producer) SendMessageSync(msg *rocketmq.Message) (*rocketmq.SendResult, error)
- func (p *Producer) Start() error
- type ProducerConfig
- type RocketMQ
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConsumerList sync.Map ProducerList sync.Map )
Functions ¶
func GetPushConsumer ¶
func GetPushConsumer(configName string) (consumer rocketmq.PushConsumer, ok bool)
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func (*Consumer) Subscribe ¶
func (c *Consumer) Subscribe(callback func(msg *rocketmq.MessageExt) rocketmq.ConsumeStatus) (err error)
type ConsumerConfig ¶
type ConsumerConfig struct { // 订阅 topic Topic string // expression Expression string // 最大次数,default = 16 MaxCount int // 超时时间(单位:秒),default = 60s Timeout int MessageModel rocketmq.MessageModel ConsumerModel rocketmq.ConsumerModel }
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func (*Producer) SendMessageOneway ¶
func (*Producer) SendMessageOrderly ¶
func (p *Producer) SendMessageOrderly(msg *rocketmq.Message, selector rocketmq.MessageQueueSelector, arg interface{}, autoRetryTimes int) (*rocketmq.SendResult, error)
func (*Producer) SendMessageOrderlyByShardingKey ¶
func (*Producer) SendMessageSync ¶
type ProducerConfig ¶
type ProducerConfig struct {
ProducerModel rocketmq.ProducerModel
}
type RocketMQ ¶
type RocketMQ struct { // 配置文件对应的 MQ client ConfigName string // contains filtered or unexported fields }
func NewRocketMQ ¶
func (*RocketMQ) NewConsumer ¶
func (r *RocketMQ) NewConsumer(c *ConsumerConfig) (consumer *Consumer, err error)
func (*RocketMQ) NewProducer ¶
func (r *RocketMQ) NewProducer(c *ProducerConfig) (producer *Producer, err error)
Click to show internal directories.
Click to hide internal directories.