rocketmqKit

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RocketMQProducer rmqClient.Producer       // 对外暴露RocketMq的生产者
	RocketMQConsumer rmqClient.SimpleConsumer // 对外暴露RocketMq的消费者

)

Functions

func Send

func Send(ctx context.Context, msg []byte, key, tag, messageGroup string) error

Send 发送消息

  • @param ctx {context.Context} 上下文
  • @param msg {[]byte} 消息主体
  • @param key {string}
  • @param tag {string}
  • @param messageGroup {string}

func Subscription

func Subscription(ctx context.Context, maxMessageNum int32, invisibleDuration int) error

Subscription 消息订阅 *自定义程度过高,目前返回通用的Any数据包,自行解包

Types

type RocketMQConfig

type RocketMQConfig struct {
	Topic     string `json:"topic"`     // Topic 主题
	Endpoint  string `json:"endpoint"`  // Endpoint 端点
	Namespace string `json:"nameSpace"` // 命名空间
	GroupName string `json:"groupName"` // 组名
	AccessKey string `json:"accessKey"` // AccessKey 访问密钥
	SecretKey string `json:"secretKey"` // SecretKey 密钥
	WaitTime  int    `json:"waitTime"`  // 等待时间
}

func (*RocketMQConfig) InitRocketMQConsumers

func (r *RocketMQConfig) InitRocketMQConsumers() error

InitRocketMQConsumers 初始化消费者

  • @param ctx {context.Context} 上下文
  • @param maxMessageNum {int32} 最大消息数
  • @param invisibleDuration {int} 持续时间·单位s

func (*RocketMQConfig) InitRocketMqProducers

func (r *RocketMQConfig) InitRocketMqProducers() error

InitRocketMqProducers 初始化rocketMq生产者

Jump to

Keyboard shortcuts

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