Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶ added in v1.3.3
func SetLogLevel(level string)
SetLogLevel set rocket mq log level
Types ¶
type ConsumerConfig ¶
type ConsumerConfig struct {
Endpoint []string
AccessKey string
SecretKey string
Topic string
Gid string
Tags []string
Retry int32
Orderly bool
// contains filtered or unexported fields
}
ConsumerConfig RocketMQ consumer config
type Interceptor ¶ added in v1.3.3
type Interceptor = primitive.Interceptor
Interceptor is an alias of primitive.Interceptor
type MessageExt ¶ added in v1.3.3
type MessageExt = primitive.MessageExt
MessageExt is an alias of primitive.MessageExt
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer producer config
func NewProducer ¶
func NewProducer(config *ProducerConfig) *Producer
NewProducer returns a Producer instance
func (*Producer) SendAsyncMsg ¶
func (p *Producer) SendAsyncMsg(ctx context.Context, content string, callback func(context.Context, *primitive.SendResult, error), tags ...string) error
SendAsyncMsg send message async
func (*Producer) SendSyncMsg ¶
SendSyncMsg send message sync
type ProducerConfig ¶
type ProducerConfig struct {
Endpoint []string
AccessKey string
SecretKey string
Retry int
SendTimeout time.Duration
Topic string
Gid string
SlowSendDuration time.Duration
// contains filtered or unexported fields
}
ProducerConfig RocketMQ producer config
type PushConsumer ¶
type PushConsumer struct {
// contains filtered or unexported fields
}
PushConsumer push consumer mode
func NewPushConsumer ¶
func NewPushConsumer(config *ConsumerConfig) *PushConsumer
NewPushConsumer returns a PushConsumer instance
func (*PushConsumer) Subscribe ¶
func (pc *PushConsumer) Subscribe(cb func(context.Context, *primitive.MessageExt) error) *PushConsumer
Subscribe subscribe topic
Click to show internal directories.
Click to hide internal directories.