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 // 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 }
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.