nsqio / go-nsq

The official Go package for NSQ
MIT License
2.59k stars 444 forks source link

consumer: msg.command() error handling #172

Closed yields closed 8 years ago

yields commented 8 years ago

Is there a way to handle nsqd responses to msg.Touch(), msg.Requeue() etc..?

I have a worker that polls a resource and calls msg.Touch() to indicate work is still being done, but i've seen some logs like E_TOUCH_FAILED TOUCH 09d43c267ec2a069 failed ID not in flight, is there a way to detect that a message is not in-flight and discard it?

twmb commented 8 years ago

The message isn't in-flight because either it timed out inside nsqd and was requeued or you finished it elsewhere. There's no way to detect these failures between nsqd and go-nsq; additionally, nsqd doesn't send this type of status message back to go-nsqd.

It sounds like you might need to either reduce the interval before calling Touch or increase the msg timeout inside nsqd.

yields commented 8 years ago

got it, thanks!