rocketmq5Kit

package
v2.8.125 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AwaitDuration (Consumer)maximum waiting time for receive func
	AwaitDuration = time.Second * 5

	// MaxMessageNum (Consumer)maximum number of messages received at one time
	MaxMessageNum int32 = 64

	// InvisibleDuration (Consumer)should > 20s
	InvisibleDuration = time.Second * 20
)

Variables

View Source
var (
	NotSetupError = errorKit.New("haven’t been set up correctly")
)

Functions

func GetTagString

func GetTagString(tag *string) string

func MixTags

func MixTags(tags ...string) string

func MustSetUp

func MustSetUp(config *Config)

func NewProducer

func NewProducer() (rmq_client.Producer, error)

NewProducer

PS: In most case, you don't need to create many producers, singletion pattern is more recommended.

@param clientLogPath 客户端日志(blank则输出到控制台)

func NewSimpleConsumer

func NewSimpleConsumer(consumerGroup string, subscriptionExpressions map[string]*rmq_client.FilterExpression) (rmq_client.SimpleConsumer, error)

NewSimpleConsumer

PS: In most case, you don't need to create many consumers, singletion pattern is more recommended.

@param consumerGroup 不能为"" @param subscriptionExpressions (1) key: topic,不能为 "*" || blank

(2) value: 	tag,一般为 rmq_client.SUB_ALL

@param clientLogPath 客户端日志(blank则输出到控制台)

func SendMessage

func SendMessage(producer rmq_client.Producer, ctx context.Context, topic string, tag *string, body []byte, messageGroup string, deliveryTimestamp time.Time, keys ...string) ([]*rmq_client.SendReceipt, error)

SendMessage Deprecated: 仅供参考如何生产消息

func SetUp

func SetUp(c *Config) error

Types

type Config

type Config struct {
	Endpoints      []string                        `json:"endpoints" yaml:"endpoints"`
	Credentials    *credentials.SessionCredentials `json:"credentials,optional" yaml:"credentials"`
	ValidatedTopic string                          `json:"validatedTopic,optional" yaml:"validatedTopic"`
	ClientLogPath  string                          `json:"clientLogPath,optional" yaml:"clientLogPath"`
}

Jump to

Keyboard shortcuts

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