Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsumerOpts ¶
type ConsumerOpts struct {
NsqConfig *nsq.Config
NsqLookupdURLs []string
Topic string
Channel string
MaxInFlight int
SkipLogSet map[string]bool
LogLevel LogLevel
// PostponeProducer is an NSQ producer user to send postponed messages
PostponeProducer nsqproducer.Producer
// How long can the consumer keep the message before the message is considered as 'Timed Out'
MsgTimeout time.Duration
MessageHandler func(context.Context, *NsqMessageDeserialize) error
DisableBackoff bool
// WithoutTelemetry indicates whether OpenTelemetry instrumentation should be disabled
WithoutTelemetry bool
}
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
type LogLevel ¶ added in v1.3.0
type LogLevel int
LogLevel is a wrapper around nsq.LogLevel to ensure that the default log level is set to Warning and not Debug
func ParseLogLevel ¶ added in v1.3.0
type NsqMessageDeserialize ¶
type NsqMessageDeserialize struct {
RequestID string `json:"request_id"`
Type string `json:"type"`
At int64 `json:"at"`
Payload json.RawMessage `json:"payload"`
NsqMsg *nsq.Message
}
func FromMessageSerialize ¶
func FromMessageSerialize(msg *nsqproducer.NsqMessageSerialize) *NsqMessageDeserialize
FromMessageSerialize let you transform a Serialized message to a DeserializeMessage for a consumer Its use is mostly for testing as writing manual `json.RawMessage` is boring
func (*NsqMessageDeserialize) TouchUntilClosed ¶
func (msg *NsqMessageDeserialize) TouchUntilClosed() chan<- struct{}
TouchUntilClosed returns a channel which has to be closed by the called Until the channel is closed, the NSQ message will be touched every 40 secs to ensure NSQ does not consider the message as failed because of time out.
Click to show internal directories.
Click to hide internal directories.