aliyunmq

package
v1.5.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsumerList sync.Map
View Source
var ProducerList sync.Map

Functions

func GetProducer

func GetProducer(name string) (producer rocketmq.Producer)

func GetPushConsumer

func GetPushConsumer(name string) (consumer rocketmq.PushConsumer, err error)

Types

type ConsumeFunc

type ConsumeFunc struct {
	MaxCount int // 最大16次
	TimeOut  int // 超时时间
}

func NewConsumeFunc

func NewConsumeFunc() ConsumeFunc

func (*ConsumeFunc) Middleware

最大重试次数,超过次数发邮件报警等功能可以直接扩展

func (*ConsumeFunc) SetMaxCount added in v1.4.2

func (c *ConsumeFunc) SetMaxCount(i int)

func (*ConsumeFunc) SetTimeOut added in v1.4.2

func (c *ConsumeFunc) SetTimeOut(i int)

type Consumer

type Consumer struct {
	RocketConf     RocketMQConfig
	ConsumerConfig *rocketmq.PushConsumerConfig
}

func NewConsumer

func NewConsumer(configName string) (consumer Consumer)

func (Consumer) SetConsumerModel

func (c Consumer) SetConsumerModel(consumerModel rocketmq.ConsumerModel)

func (Consumer) SetMessageModel

func (c Consumer) SetMessageModel(messageModel rocketmq.MessageModel)

type Producer

type Producer struct {
	RocketConf     RocketMQConfig
	ProducerConfig *rocketmq.ProducerConfig
}

func NewProducer

func NewProducer(configName string) (producer Producer)

func (Producer) SetProducerModel

func (p Producer) SetProducerModel(producerModel rocketmq.ProducerModel)

type RocketMQConfig

type RocketMQConfig struct {
	GroupID string
	// 设置 TCP 协议接入点,从阿里云 RocketMQ 控制台的实例详情页面获取。
	NameServer string
	// 您在阿里云账号管理控制台中创建的 AccessKeyId,用于身份认证。
	AccessKey string
	// 您在阿里云账号管理控制台中创建的 AccessKeySecret,用于身份认证。
	SecretKey string
	// 用户渠道,默认值为:ALIYUN。
	Channel string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL