rocketmq

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

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