rocketmq

package
v2.0.79 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PanicLevel level, highest level of severity. Logs and then calls panic with the
	// message passed to Debug, Info, ...
	PanicLevel = iota
	// FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the
	// logging level is set to Panic.
	FatalLevel
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	// Commonly used for hooks to send errors to an error tracking service.
	ErrorLevel
	// WarnLevel level. Non-critical entries that deserve eyes.
	WarnLevel
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	InfoLevel
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DebugLevel
	// TraceLevel level. Designates finer-grained informational events than the Debug.
	TraceLevel
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QLoger

type QLoger struct {
	Ctx    context.Context
	Logger *glog.Logger
}

func (*QLoger) Debug

func (q *QLoger) Debug(msg string, fields map[string]interface{})

func (*QLoger) Error

func (q *QLoger) Error(msg string, fields map[string]interface{})

func (*QLoger) Fatal

func (q *QLoger) Fatal(msg string, fields map[string]interface{})

func (*QLoger) Info

func (q *QLoger) Info(msg string, fields map[string]interface{})

func (*QLoger) Level

func (q *QLoger) Level(level string)

func (*QLoger) OutputPath

func (q *QLoger) OutputPath(path string) (err error)

func (*QLoger) Warning

func (q *QLoger) Warning(msg string, fields map[string]interface{})

type RocketConsumerOptions

type RocketConsumerOptions struct {
	GroupName         string
	MaxReconsumeTimes int32
}

type RocketMQ

type RocketMQ struct {
	Urls []string

	Credentials *primitive.Credentials
	// contains filtered or unexported fields
}

RocketMQ cache implement

func NewRocketMQ

func NewRocketMQ(
	ctx context.Context,
	urls []string,
	credentials *primitive.Credentials,
	logger *glog.Logger,
) (*RocketMQ, error)

func (*RocketMQ) Consumer

func (r *RocketMQ) Consumer(ctx context.Context, topicName string, f queueLib.ConsumerFunc, optionFuncs ...func(*queueLib.ConsumeOptions))

Consumer 监听消费者

func (*RocketMQ) Publish

func (r *RocketMQ) Publish(ctx context.Context, message messageLib.IMessage, optionFuncs ...func(*queueLib.PublishOptions)) error

Publish 消息入生产者

func (*RocketMQ) RpcRequest added in v2.0.23

func (r *RocketMQ) RpcRequest(ctx context.Context, key string, data []byte, optionFuncs ...func(*queueLib.ClientOptions)) ([]byte, error)

func (*RocketMQ) Run

func (r *RocketMQ) Run(ctx context.Context)

func (*RocketMQ) Shutdown

func (r *RocketMQ) Shutdown(ctx context.Context)

func (*RocketMQ) String

func (r *RocketMQ) String() string

type RocketProducerOptions

type RocketProducerOptions struct {
	GroupName  string
	RetryTimes int
}

Jump to

Keyboard shortcuts

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