Documentation ¶
Index ¶
Constants ¶
View Source
const ( MsgTypeNormalName = "Normal" // 普通消息 MsgTypeFIFOName = "FIFO" // 顺序消息 MsgTypeDelayName = "Delay" // 延迟消息 MsgTypeTransactionName = "Transaction" // 事务消息 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { EndPoint string `json:"endPoint" yaml:"endPoint"` Group string `json:"group" yaml:"group"` Region string `json:"region" yaml:"region"` AccessKey string `json:"accessKey" yaml:"accessKey"` AccessSecret string `json:"accessSecret" yaml:"accessSecret"` DialTimeout time.Duration `json:"dialTimeout" yaml:"dialTimeout"` }
type Consumer ¶
type Consumer struct { Id string Name string Handler ConsumerHandler // contains filtered or unexported fields }
type ConsumerConfig ¶
type Message ¶
type Message struct { RequestId string MsgId string UserMessageId string MessageType MessageType Body any Topic string MessageGroup string DelayTime time.Duration }
func (*Message) GetMessageType ¶
func (m *Message) GetMessageType(messageTypeName string) MessageType
func (*Message) IsLegalTopic ¶
func (*Message) IsLegalType ¶
type MessageType ¶
type MessageType int
const ( MsgTypeNormal MessageType = 8 << iota // 普通消息 MsgTypeFIFO // 顺序消息 MsgTypeDelay // 延迟消息 MsgTypeTransaction // 事务消息 )
消息类型的常量定义
func (MessageType) ToString ¶
func (messageType MessageType) ToString() string
type ProducerConfig ¶
type ProducerConfig struct { Name string Topics []string TransactionChecker TransactionCheckFunc }
type RocketMq ¶
type RocketMq struct { ProducerList map[string]*Producer ConsumerList map[string]*Consumer // contains filtered or unexported fields }
func (*RocketMq) NewConsumer ¶
func (mq *RocketMq) NewConsumer(cfg ConsumerConfig) *Consumer
func (*RocketMq) NewProducer ¶
func (mq *RocketMq) NewProducer(cfg *ProducerConfig) *Producer
type TransactionCheckFunc ¶
type TransactionCheckFunc func(msg *golang.MessageView) golang.TransactionResolution
Click to show internal directories.
Click to hide internal directories.