Documentation
¶
Index ¶
- func New(cfg *conf.Configuration) (pubsub.Provider, error)
- type ConsumerConfig
- type ProducerConfig
- type Provider
- func (p *Provider) GetMQType() string
- func (p *Provider) Publish(ctx context.Context, opts pubsub.PublishOptions, m *pubsub.Message) (err error)
- func (p *Provider) Start(ctx context.Context) error
- func (p *Provider) Stop(ctx context.Context) error
- func (p *Provider) Subscribe(opts pubsub.HandlerOptions, handler pubsub.MessageHandler) error
- type ProviderConfig
- type TopicKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsumerConfig ¶ added in v0.0.4
type ConsumerConfig struct {
Topic string
Group string
MessageTag string
Kind TopicKind
// ConsumeMessageBatchMaxSize 单次消费消息数量, 默认以顺序消费合理值1为默认值
ConsumeMessageBatchMaxSize int
// MaxReconsumeTimes 最大重试次数,对于顺序消费,其为本地重试次数
// 最多16次, 10s,30s,1m,此后每次重试的时间间隔是上一次的 2 倍
MaxReconsumeTimes int
// SuspendCurrentQueueTimeMillis 消息消费失败后再次被投递给Consumer消费的间隔时间,只在顺序消费中起作用
// 需要注意的 实际消息次数 = 第一次 + MaxReconsumeTimes + 1, 最后一次暂时不确定
SuspendCurrentQueueTimeMillis time.Duration
}
type ProducerConfig ¶ added in v0.0.4
type Provider ¶
type Provider struct {
ProviderConfig
// contains filtered or unexported fields
}
func (*Provider) Subscribe ¶
func (p *Provider) Subscribe(opts pubsub.HandlerOptions, handler pubsub.MessageHandler) error
type ProviderConfig ¶
type ProviderConfig struct {
EndPoint string
AccessKey string
SecretKey string
InstanceID string
Consumers map[string]ConsumerConfig
Producers map[string]ProducerConfig
}
Click to show internal directories.
Click to hide internal directories.