Documentation ¶
Index ¶
- Constants
- Variables
- func DeregisterProducer(name string)
- func DeregisterrConsumer(name string)
- func NewBuilder() container.StandardBuilder
- func RegisterConsumer(resolver MqcResover)
- func RegisterProducer(resolver MqpResover)
- type ConsumeCallback
- type IComponentQueue
- type IMQC
- type IMQCMessage
- type IMQP
- type IQueue
- type Message
- type MqcResover
- type MqpResover
- type MsgItem
- type MsgOption
- type MsgWrap
- type Option
- type Options
- type StandardQueue
- type TaskInfo
Constants ¶
View Source
const (
QueueKey string = "qk"
)
View Source
const (
TypeNode = "queues"
)
Variables ¶
View Source
var DefaultMaxQueueLen = 100
默认最大队列长度 100
View Source
var (
MaxRetrtCount int64 = 3 //最大重试三次
)
View Source
var Nil error = errors.New("Queue Nil")
Functions ¶
func NewBuilder ¶
func NewBuilder() container.StandardBuilder
Types ¶
type ConsumeCallback ¶
type ConsumeCallback func(IMQCMessage)
type IComponentQueue ¶
IComponentQueue Component Queue
type IMQC ¶
type IMQC interface { Connect() error Consume(task TaskInfo, callback ConsumeCallback) (err error) Unconsume(queue string) Start() Close() }
IMQC consumer接口
type IMQCMessage ¶
type IMQCMessage interface { RetryCount() int64 Ack() error Nack(error) error Original() string GetMessage() Message }
IMQCMessage 队列消息
type IMQP ¶
type IMQP interface { Push(key string, value Message) error DelayPush(key string, value Message, delaySeconds int64) error Count(key string) (int64, error) Close() error }
IMQP 消息生产
type IQueue ¶
type IQueue interface { Send(ctx context.Context, key string, value interface{}) error DelaySend(ctx context.Context, key string, value interface{}, delaySeconds int64) error Count(key string) (int64, error) }
IQueue 消息队列
type MqcResover ¶ added in v0.4.4
type MqcResover interface { Name() string Resolve(configName string, setting config.Config) (IMQC, error) }
mqcResover 定义消息消费解析器
type MqpResover ¶ added in v0.4.4
type MqpResover interface { Name() string Resolve(setting config.Config, opts ...Option) (IMQP, error) }
MqpResover 定义配置文件转换方法
type MsgItem ¶
type MsgOption ¶ added in v0.4.3
type MsgOption func(m *MsgWrap)
func WithHeader ¶ added in v0.3.0
func WithXRequestID ¶ added in v0.3.0
type MsgWrap ¶ added in v0.3.0
type Option ¶ added in v0.3.0
type Option func(*Options)
Option 配置选项
func WithDBIndex ¶ added in v0.4.3
func WithOption ¶ added in v0.4.3
func WithPoolSize ¶ added in v0.4.3
type StandardQueue ¶
func NewStandardQueue ¶
func NewStandardQueue(c container.Container) StandardQueue
NewStandardQueue 创建queue
Click to show internal directories.
Click to hide internal directories.