producer

package
v0.0.0-...-38d955b Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DQProducerClientId = "delayQueue-producer"

Variables

View Source
var ErrDelayTimeNotRegister = errors.New("The delay is not registered. Check whether the delay is sent by mistake ")
View Source
var ErrRegisteredDelayQueueNotEmpty = errors.New("The registered delay queue cannot be empty ")

Functions

This section is empty.

Types

type DQProducer

type DQProducer struct {
	sarama.SyncProducer
	// contains filtered or unexported fields
}

func NewDQProducer

func NewDQProducer(name string, registerDelay []time.Duration, addr []string, options ...Options) (*DQProducer, error)

NewDQProducer create a producer

func (*DQProducer) RegisterTopic

func (s *DQProducer) RegisterTopic(delayTime time.Duration) string

RegisterTopic Get topic by delay time.

func (*DQProducer) Send

func (s *DQProducer) Send(delayTime time.Duration, payload []byte, processTopic string) error

Send a delay message note.

The delay time must be registered.
Registered delay messages must be consumed.

type Options

type Options func(*DQProducer)

func WithLogger

func WithLogger(logger logger.Logger) Options

WithLogger Setting the Log Interface

func WithTimezone

func WithTimezone(timezone string) Options

WithTimezone Set the timezone

Jump to

Keyboard shortcuts

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