Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to just consume new messages regardless of old messages?? #134

Closed
sundy-li opened this issue Apr 15, 2015 · 1 comment
Closed

How to just consume new messages regardless of old messages?? #134

sundy-li opened this issue Apr 15, 2015 · 1 comment
Labels

Comments

@sundy-li
Copy link

My server started a conusmer to consume messages, then I stop it for 3 days, then I start my server again, the old message make no sense to me (cause I use nsq for realtime notification), I just want to consume the new messages, how to solve it without consuming in new channel?

@jehiah
Copy link
Member

jehiah commented Apr 15, 2015

If you want to drop all messages you can use the "Empty Channel" option in nsqadmin, or the matching nsqd API endpoint.

It sounds like you have a hard limit on where after which data is useless for you (might be an hour, or a day or something like that). In that case you can embed a timestamp in your messages and just immediately finish messages that are too old w/o doing any additional processing. If you don't have a timestamp in your messages (which i highly recommend) you can use Message.Timestamp exposed by go-nsq.

@jehiah jehiah closed this as completed Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants