aliyun_rocketmq_go

package module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 7 Imported by: 0

README

aliyun-rocketmq-go

Simple packaging for Aliyun RocketMQ; For Go language

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumeFrom added in v1.0.1

type ConsumeFrom consumer.ConsumeFromWhere

type RocketHelper

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

func NewRocketHelper

func NewRocketHelper(opts *RocketHelperOptions) *RocketHelper

func (*RocketHelper) CreateMessage added in v1.0.7

func (rh *RocketHelper) CreateMessage(topic string, body []byte, tag string, keys []string, properties map[string]string) *primitive.Message

func (*RocketHelper) CreatePushConsumer

func (rh *RocketHelper) CreatePushConsumer() (rocketmq.PushConsumer, error)

func (*RocketHelper) NewProducer

func (rh *RocketHelper) NewProducer() (rocketmq.Producer, error)

func (*RocketHelper) PushConsume

func (rh *RocketHelper) PushConsume(topic string, tagFilter string, onMessage func(*primitive.MessageExt) error) error

func (*RocketHelper) PushConsumeByConsumer

func (rh *RocketHelper) PushConsumeByConsumer(c rocketmq.PushConsumer, topic string, selector consumer.MessageSelector, onMessage func(*primitive.MessageExt) error) error

func (*RocketHelper) SendMessage

func (rh *RocketHelper) SendMessage(ctx context.Context, msg *primitive.Message) (*primitive.SendResult, error)

func (*RocketHelper) SendMessageByProducer

func (rh *RocketHelper) SendMessageByProducer(ctx context.Context, p rocketmq.Producer, msg *primitive.Message) (*primitive.SendResult, error)

type RocketHelperOptions

type RocketHelperOptions struct {
	Endpoint        string      // Aliyun RocketMQ 服务接入点
	InstanceId      string      // Aliyun RocketMQ 服务实例标识
	GroupId         string      // 客户端 Group 标识
	ConsumeFrom     ConsumeFrom // 初次消息消费开始位置
	AccessKeyId     string
	AccessKeySecret string
}

func (*RocketHelperOptions) GetCredentials

func (opts *RocketHelperOptions) GetCredentials() primitive.Credentials

Jump to

Keyboard shortcuts

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