cetacean

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = logrus.New()

Functions

func DefaultErrorCallback

func DefaultErrorCallback(err error, msg *primitive.MessageExt)

func InitProducerGroup

func InitProducerGroup(conf *RocketMQCredentials)

func NewConsumer

func NewConsumer(setters ...Setter) error

func SendSyncMessage

func SendSyncMessage(msg *MQProducerMessage) error

Types

type ConsumerGroup

type ConsumerGroup struct {
	GroupID string // 唯一消费组id
	Topic   string // 订阅主题
	Tag     string // 主题下的tag
}

consumer group

type ErrorCallback

type ErrorCallback func(err error, msg *primitive.MessageExt)

type Handler

type Handler func([]byte) error

type MQProducerMessage

type MQProducerMessage struct {
	// Topic .
	Topic string
	// Tag .
	Tag string
	// GroupID producer group_id
	GroupID string
	// Property extra info,tag is here,use primitive.PropertyTags
	Property map[string]string
	// Body msg to send
	Body string
}

type Producer

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

type ProducerGroup

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

func (*ProducerGroup) Get

func (m *ProducerGroup) Get(msg *MQProducerMessage) (*Producer, error)

type ProducerWrapper

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

type PushConsumer

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

type RocketMQCredentials

type RocketMQCredentials struct {
	Endpoint   string
	AccessKey  string
	SecretKey  string
	InstanceID string
}

rocket mq connection config

type Setter

type Setter func(c *PushConsumer) error

func WithConsumeGroup

func WithConsumeGroup(g *ConsumerGroup) Setter

func WithConsumerModel

func WithConsumerModel(model consumer.MessageModel) Setter

func WithCredentials

func WithCredentials(cdt *RocketMQCredentials) Setter

func WithErrorCallback

func WithErrorCallback(callback ErrorCallback) Setter

func WithHandler

func WithHandler(h ...Handler) Setter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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