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

nsqd: allowing clients to integrate with message ID? #633

Closed
Dieterbe opened this issue Aug 15, 2015 · 2 comments
Closed

nsqd: allowing clients to integrate with message ID? #633

Dieterbe opened this issue Aug 15, 2015 · 2 comments
Labels

Comments

@Dieterbe
Copy link
Contributor

I'm tracing messages through my nsq flow and i note:

  • when consuming a message and publishing the same message to another topic, it'll get a new id.
  • there's no way to set the message ID at publish time, or get it as a return value from the Publish function

because I need a consistent ID of messages as they are published, consumed (and potentially re-published and re-consumed) so i can trace them throughout the pipeline, I have to basically put my own ID in the first 16 bytes of all messages.
but this seems awkward, especially since the message api does expose the ID property publically, but i can't do what i want with it, so i still have to write my own logic for writing and reading ID's, and now all messages essentially have 2 ID's.

would it be acceptable for producers to provide ID's to use when publishing messages?
is there anything harmfull about re-using the existing ID when republishing a given existing (just-consumed) message to a new topic?

thanks

@mreiferson
Copy link
Member

Originally we thought it might be useful for NSQ's message IDs to be globally unique and transparent to the user. You're basically seeing the side-effects of these admittedly half-baked ideas.

As it has played out, message IDs are effectively an internal implementation detail. The best path forward is to more explicitly enforce that, by making all of those exposed touch points private - potentially as part of #367?

In short, it is highly recommended (required?) that you use your own message IDs and pretend that NSQ's aren't actually exposed, because at some point in the future that will be true. This addresses all of the issues you've highlighted except for the "inefficiency" of technically having two IDs, which I don't think has any practical impact.

Gonna close, because this doesn't feel like an actionable issue - we can continue the discussion in IRC or on the mailing list.

@mreiferson mreiferson changed the title allowing clients to integrate with message ID'? nsqd: allowing clients to integrate with message ID? Aug 16, 2015
@Dieterbe
Copy link
Contributor Author

fair enough, thanks.

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