rocketmq

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 11 Imported by: 1 module, 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.

README

RocketMQ

Broker: RocketMQ

You can run examples by replace configs use your rocketmq instance configs.

Typically log msg in interceptors, default provide producer and push consumer inteceptor.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerConfig

type ConsumerConfig struct {
	Endpoint  []string
	AccessKey string
	SecretKey string
	Namespace string

	Topic string
	Gid   string
	Tags  []string

	Orderly bool
	// contains filtered or unexported fields
}

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

func NewProducer

func NewProducer(config *ProducerConfig) *Producer

func (*Producer) SendAsyncMsg

func (p *Producer) SendAsyncMsg(ctx context.Context, content string, callback func(context.Context, *primitive.SendResult, error)) error

func (*Producer) SendSyncMsg

func (p *Producer) SendSyncMsg(ctx context.Context, content string) error

func (*Producer) Shutdown

func (p *Producer) Shutdown() error

func (*Producer) Start

func (p *Producer) Start() error

type ProducerConfig

type ProducerConfig struct {
	Endpoint  []string
	AccessKey string
	SecretKey string
	Namespace string

	Retry       int
	SendTimeout time.Duration

	Topic string
	Tags  []string

	SlowSendDuration time.Duration
	// contains filtered or unexported fields
}

type PushConsumer

type PushConsumer struct {
	// contains filtered or unexported fields
}

func NewPushConsumer

func NewPushConsumer(config *ConsumerConfig) *PushConsumer

func (*PushConsumer) Shutdown

func (pc *PushConsumer) Shutdown() error

func (*PushConsumer) Start

func (pc *PushConsumer) Start() error

func (*PushConsumer) Subscribe

func (pc *PushConsumer) Subscribe(cb func(context.Context, *primitive.MessageExt) error) *PushConsumer

Directories

Path Synopsis
examples
consumer command
producer command

Jump to

Keyboard shortcuts

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