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