rmq

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConsumer

func GetConsumer(name string, opts ...consumer.Option) (rocketmq.PushConsumer, error)

func GetProducer

func GetProducer(name string, opts ...producer.Option) (rocketmq.Producer, error)

func NewConsumer

func NewConsumer(c *ConsumerConfig) (rocketmq.PushConsumer, error)

func NewProducer

func NewProducer(c *ProducerConfig) (rocketmq.Producer, error)

func SetupLogger

func SetupLogger(level log.Level, pname string)

Types

type ConsumerConfig

type ConsumerConfig struct {
	NameSrvAddr    []string `json:"name_srv_addr" yaml:"name_srv_url"`                // name srv地址
	GroupName      string   `json:"group_name,omitempty" yaml:"group_name"`           // 组名
	ConsumerModel  int      `json:"consumer_model,omitempty" yaml:"consumer_model"`   // 0-广播模式 1-集群模式
	UseCredentials bool     `json:"use-credentials,omitempty" yaml:"use_credentials"` // 是否需要身份验证
	AccessKey      string   `json:"access_key,omitempty" yaml:"access_key"`           // AccessKey 阿里云身份验证,在阿里云服务器管理控制台创建
	SecretKey      string   `json:"secret_key,omitempty" yaml:"secret_key"`           // SecretKey 阿里云身份验证,在阿里云服务器管理控制台创建
	ConsumerOrder  bool     `json:"consumer_order,omitempty" yaml:"consumer_order"`   // 是否顺序消费
}

type ProducerConfig

type ProducerConfig struct {
	NameSrvAddr    []string `json:"name_srv_addr" yaml:"name_srv_addr"`
	UseCredentials bool     `json:"use_credentials,omitempty" yaml:"use_credentials"`
	AccessKey      string   `json:"access_key,omitempty" yaml:"access_key"`
	SecretKey      string   `json:"secret_key,omitempty" yaml:"secret_key"`
	Group          string   `json:"group,omitempty" yaml:"group"`
}

Jump to

Keyboard shortcuts

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