Documentation ¶
Index ¶
- type Config
- type ConsumerConfig
- type FlowInfo
- type Producer
- func (pc *Producer) Close() error
- func (pc *Producer) Send(msg []byte) error
- func (pc *Producer) SendMsg(msg *primitive.Message) (*primitive.SendResult, error)
- func (pc *Producer) SendWithContext(ctx context.Context, msg []byte) error
- func (pc *Producer) SendWithResult(msg []byte, tag string) (*primitive.SendResult, error)
- func (pc *Producer) SendWithTag(msg []byte, tag string) error
- func (pc *Producer) Start() error
- func (pc *Producer) WithInterceptor(fs ...primitive.Interceptor) *Producer
- type ProducerConfig
- type PushConsumer
- type Shadow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addresses []string `json:"addr" toml:"addr"` Consumer *ConsumerConfig `json:"consumer" toml:"consumer"` Producer *ProducerConfig `json:"producer" toml:"producer"` }
Config config...
type ConsumerConfig ¶
type ConsumerConfig struct { Name string `json:"name" toml:"name"` Enable bool `json:"enable" toml:"enable"` Addr []string `json:"addr" toml:"addr"` Topic string `json:"topic" toml:"topic"` Group string `json:"group" toml:"group"` DialTimeout time.Duration `json:"dialTimeout" toml:"dialTimeout"` RwTimeout time.Duration `json:"rwTimeout" toml:"rwTimeout"` SubExpression string `json:"subExpression" toml:"subExpression"` Rate float64 `json:"rate" toml:"rate"` Capacity int64 `json:"capacity" toml:"capacity"` WaitMaxDuration time.Duration `json:"waitMaxDuration" toml:"waitMaxDuration"` Shadow Shadow `json:"shadow" toml:"shadow"` Reconsume int32 `json:"reconsume" toml:"reconsume"` AccessKey string `json:"accessKey" toml:"accessKey"` SecretKey string `json:"secretKey" toml:"secretKey"` }
ConsumerConfig consumer config
func StdPushConsumerConfig ¶
func StdPushConsumerConfig(name string) *ConsumerConfig
StdPushConsumerConfig ...
func (*ConsumerConfig) Build ¶
func (conf *ConsumerConfig) Build() *PushConsumer
type Producer ¶
type Producer struct { rocketmq.Producer ProducerConfig // contains filtered or unexported fields }
func GetProducer ¶
func StdNewProducer ¶
func (*Producer) SendWithContext ¶
SendWithContext 发送消息
func (*Producer) SendWithResult ¶
SendWithResult rocket mq 发送消息,可以自定义选择 tag 及返回结果
func (*Producer) SendWithTag ¶
SendWithTag rocket mq 发送消息,可以自定义选择 tag
func (*Producer) WithInterceptor ¶
func (pc *Producer) WithInterceptor(fs ...primitive.Interceptor) *Producer
type ProducerConfig ¶
type ProducerConfig struct { Name string `json:"name" toml:"name"` Addr []string `json:"addr" toml:"addr"` Topic string `json:"topic" toml:"topic"` Group string `json:"group" toml:"group"` Retry int `json:"retry" toml:"retry"` DialTimeout time.Duration `json:"dialTimeout" toml:"dialTimeout"` RwTimeout time.Duration `json:"rwTimeout" toml:"rwTimeout"` Shadow Shadow `json:"shadow" toml:"shadow"` AccessKey string `json:"accessKey" toml:"accessKey"` SecretKey string `json:"secretKey" toml:"secretKey"` }
ProducerConfig producer config
func (*ProducerConfig) Build ¶
func (conf *ProducerConfig) Build() *Producer
type PushConsumer ¶
type PushConsumer struct { rocketmq.PushConsumer ConsumerConfig // contains filtered or unexported fields }
func (*PushConsumer) Close ¶
func (cc *PushConsumer) Close() error
func (*PushConsumer) Start ¶
func (cc *PushConsumer) Start() error
func (*PushConsumer) Subscribe ¶
func (cc *PushConsumer) Subscribe(topic string, f func(context.Context, *primitive.MessageExt) error) *PushConsumer
func (*PushConsumer) WithInterceptor ¶
func (cc *PushConsumer) WithInterceptor(fs ...primitive.Interceptor) *PushConsumer
Click to show internal directories.
Click to hide internal directories.