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 DelayCallback
- type DelayProcessor
- 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 DelayCallback ¶ added in v0.4.6
DelayCallback 延迟消息处理回调
type DelayProcessor ¶ added in v0.4.6
type DelayProcessor interface { Start(done chan struct{}) error AppendMessage(msg Message, delaySeconds int64) error }
DelayProcessor 延迟消息队列处理器
type IComponentQueue ¶
IComponentQueue Component Queue
type IMQC ¶
type IMQC interface { Connect() error Consume(task TaskInfo, callback ConsumeCallback) (err error) Unconsume(queue string) Start() error Close() error }
IMQC consumer接口
type IMQCMessage ¶
type IMQCMessage interface { MessageId() string 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 }
IQueue 消息队列
type Message ¶
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 MsgItem struct { HeaderMap xtypes.SMap `json:"header"` BodyBytes json.RawMessage `json:"body"` ItemBytes json.RawMessage `json:"-"` }
func (MsgItem) MarshalBinary ¶ added in v0.4.6
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 MsgWrap struct { HeaderMap xtypes.SMap `json:"header,omitempty"` BodyBytes json.RawMessage `json:"body"` // contains filtered or unexported fields }
func (MsgWrap) MarshalBinary ¶ added in v0.4.6
type Option ¶ added in v0.3.0
type Option func(*Options)
Option 配置选项
func WithOption ¶ added in v0.4.3
type Options ¶ added in v0.4.3
func DefaultOptions ¶ added in v0.5.7
func DefaultOptions() *Options
type StandardQueue ¶
func NewStandardQueue ¶
func NewStandardQueue(c container.Container) StandardQueue
NewStandardQueue 创建queue
Click to show internal directories.
Click to hide internal directories.