rocketmqKit

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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