zhangqian
2023-10-09 41a9bf370cff977ff8afe122a7610e07fa6c3b80
pkg/nsqclient/consumer.go
@@ -18,7 +18,7 @@
   channel   string
}
func NewNsqConsumer(ctx context.Context, topic, channel string, options ...func(*nsq.Config)) (*NsqConsumer, error) {
func NewNsqConsumer(topic, channel string, options ...func(*nsq.Config)) (*NsqConsumer, error) {
   conf := nsq.NewConfig()
   conf.MaxAttempts = 0
   conf.MsgTimeout = 10 * time.Minute         // 默认一个消息最多能处理十分钟,否则就会重新丢入队列
@@ -33,7 +33,6 @@
   }
   return &NsqConsumer{
      consumer: consumer,
      ctx:      ctx,
      topic:    topic,
      channel:  channel,
   }, nil