Documentation ¶
Index ¶
- Constants
- func RegisterKafkaProducer(connOpt KafkaConfig, mqIns *KafkaMq)
- type Consumer
- type KafkaConfig
- type KafkaMq
- type MqConsumer
- func NewConsumer(groupName string) (mqClient MqConsumer, err error)
- func RegisterKafkaMqConsumerMust(connOpt KafkaConfig) (client MqConsumer)
- func RegisterRedisMqConsumerMust(connOpt RedisOption, poolOpt PoolOption, groupName string) (client MqConsumer)
- func RegisterRocketConsumerMust(endPoints []string, groupName string) (client MqConsumer)
- type MqMsg
- type MqProducer
- func NewProducer(groupName string) (mqClient MqProducer, err error)
- func RegisterKafkaProducerMust(connOpt KafkaConfig) (client MqProducer)
- func RegisterRedisMqProducerMust(connOpt RedisOption, poolOpt PoolOption, groupName string, retry int) (client MqProducer)
- func RegisterRocketProducerMust(endPoints []string, groupName string, retry int) (client MqProducer)
- type PoolOption
- type Queue
- type RedisMq
- type RedisOption
- type RocketMq
Constants ¶
View Source
const ( SendMsg ReceiveMsg )
Variables ¶
This section is empty.
Functions ¶
func RegisterKafkaProducer ¶ added in v0.2.33
func RegisterKafkaProducer(connOpt KafkaConfig, mqIns *KafkaMq)
RegisterKafkaProducerAsync 注册同步类型实例
Types ¶
type Consumer ¶ added in v0.2.33
type Consumer struct {
// contains filtered or unexported fields
}
func (*Consumer) Cleanup ¶ added in v0.2.33
func (consumer *Consumer) Cleanup(sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
func (*Consumer) ConsumeClaim ¶ added in v0.2.33
func (consumer *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().
type KafkaConfig ¶ added in v0.2.33
type KafkaMq ¶ added in v0.2.33
type KafkaMq struct { Partitions int32 // contains filtered or unexported fields }
func (*KafkaMq) ListenReceiveMsgDo ¶ added in v0.2.33
ListenReceiveMsgDo 消费数据
func (*KafkaMq) SendByteMsg ¶ added in v0.2.33
SendByteMsg 生产数据
type MqConsumer ¶ added in v0.2.14
type MqConsumer interface {
ListenReceiveMsgDo(topic string, receiveDo func(mqMsg MqMsg)) (err error)
}
func NewConsumer ¶ added in v0.2.14
func NewConsumer(groupName string) (mqClient MqConsumer, err error)
NewConsumer 新建一个消费者实例
func RegisterKafkaMqConsumerMust ¶ added in v0.2.33
func RegisterKafkaMqConsumerMust(connOpt KafkaConfig) (client MqConsumer)
RegisterRedisMqConsumerMust 注册消费者
func RegisterRedisMqConsumerMust ¶ added in v0.2.14
func RegisterRedisMqConsumerMust(connOpt RedisOption, poolOpt PoolOption, groupName string) (client MqConsumer)
RegisterRedisMqConsumerMust 注册消费者
func RegisterRocketConsumerMust ¶ added in v0.2.14
func RegisterRocketConsumerMust(endPoints []string, groupName string) (client MqConsumer)
RegisterRocketConsumerMust 注册消费者
type MqMsg ¶ added in v0.2.14
type MqMsg struct { RunType int `json:"run_type"` Topic string `json:"topic"` MsgId string `json:"msg_id"` Offset int64 `json:"offset"` Partition int32 `json:"partition"` Timestamp time.Time `json:"timestamp"` Body []byte `json:"body"` }
func (*MqMsg) BodyString ¶ added in v0.2.14
type MqProducer ¶ added in v0.2.14
type MqProducer interface { SendMsg(topic string, body string) (mqMsg MqMsg, err error) SendByteMsg(topic string, body []byte) (mqMsg MqMsg, err error) }
func NewProducer ¶ added in v0.2.14
func NewProducer(groupName string) (mqClient MqProducer, err error)
NewProducer 新建一个生产者实例
func RegisterKafkaProducerMust ¶ added in v0.2.33
func RegisterKafkaProducerMust(connOpt KafkaConfig) (client MqProducer)
RegisterKafkaProducerMust 注册并启动生产者接口实现
func RegisterRedisMqProducerMust ¶ added in v0.2.14
func RegisterRedisMqProducerMust(connOpt RedisOption, poolOpt PoolOption, groupName string, retry int) (client MqProducer)
func RegisterRocketProducerMust ¶ added in v0.2.14
func RegisterRocketProducerMust(endPoints []string, groupName string, retry int) (client MqProducer)
RegisterRocketProducerMust 注册并启动生产者接口实现
type PoolOption ¶ added in v0.2.14
type RedisMq ¶ added in v0.2.14
type RedisMq struct {
// contains filtered or unexported fields
}
func RegisterRedisMq ¶ added in v0.2.14
func RegisterRedisMq(connOpt RedisOption, poolOpt PoolOption, groupName string, retry int) (mqIns *RedisMq, err error)
RegisterRedisMq 注册redismq实例
func (*RedisMq) ListenReceiveMsgDo ¶ added in v0.2.14
ListenReceiveMsgDo 消费数据
func (*RedisMq) SendByteMsg ¶ added in v0.2.14
SendByteMsg 生产数据
type RedisOption ¶ added in v0.2.14
type RocketMq ¶ added in v0.2.14
type RocketMq struct {
// contains filtered or unexported fields
}
func RegisterRocketMqConsumer ¶ added in v0.2.14
RegisterRocketMqConsumer 注册rocketmq消费者
func RegisterRocketMqProducer ¶ added in v0.2.14
func RegisterRocketMqProducer(endPoints []string, groupName string, retry int) (mqIns *RocketMq, err error)
RegisterRocketMqProducer 注册rocketmq生产者
func (*RocketMq) ListenReceiveMsgDo ¶ added in v0.2.14
ListenReceiveMsgDo 消费数据
func (*RocketMq) SendByteMsg ¶ added in v0.2.14
SendByteMsg 生产数据
Click to show internal directories.
Click to hide internal directories.