consumer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Zlib Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConOk   = Status(0)
	ConFail = Status(1)
)
View Source
const (
	ConTypePush = Type(0)
	ConTypePull = Type(1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Start() error

	Stop()

	//Subscribe 建议外面使用 go goroutine
	Subscribe(topic Topic, exp Expression, call func(msg *Message) Status) error
}

func NewConsumer

func NewConsumer(con Type, cfg server.MqConfig) Consumer

func NewPullConsumer

func NewPullConsumer(cfg server.MqConfig) Consumer

func NewPushConsumer

func NewPushConsumer(cfg server.MqConfig) Consumer

type Expression

type Expression struct {
	Type string
	Exp  string
}

type Message

type Message struct {
	MsgId    string
	QueueId  int
	Topic    string
	Tags     string
	Keys     string
	Body     string
	Property map[string]string
}

type Status

type Status int

type Topic

type Topic struct {
	Topic      string
	BrokerName string
	QueueId    int
}

type Type

type Type int

Jump to

Keyboard shortcuts

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