-
Notifications
You must be signed in to change notification settings - Fork 55
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
docs: clarify when topics are created automatically #42
Comments
When connecting to NSQ through |
But I can’t let all of channels receive the message if subscribers before first publish. |
The case where a topic does not exist anywhere yet is somewhat special. nsqadmin has a page where you can pre-create topics and channels, the "Lookup" page: http://localhost:4171/lookup - it makes requests to nsqlookupd to remember them. When nsqd gets a message that creates a new topic, it first asks nsqlookupd for a list of channels for that topic, and creates them before the topic starts passing messages, so all channels get the first message. It will still take around 30 seconds or so for running consumers to find out that a topic has appeared on an nsqd which the topic did not exist on before. You can similarly pre-create the topic on the nsqd (though there's no nsqadmin UI for it, you have to use an http client like curl). When consumers start up, they'll find all nsqd that already have that topic right away (if those nsqd have had that topic for at least 30 seconds or so). |
... but imagine a more "typical" scenario where you publish a test message on some server first, then start up all consumers, then a few minutes later start publishing messages for real, including on new servers ... then this all works correctly without any manual pre-create steps (though that first test message is lost for some channels) |
Thanks, it works, I had tried it yesterday.
And you give a better suggestion. Can you modify the documents on the design page? Because it may mislead other users.
|
Yeah, that's the take-away, the docs for this could use some more detail. |
leaving this open, seems like a useful improvement to the docs... |
moving this issue to https://github.com/nsqio/nsqio.github.io |
Now I am experiencing the same problem, please tell me how to solve it |
As the document says, topic will be created on first use by subscribing.
but it does not.
my environments are as below:
what did I do?
started nsqd , nsqlookupd and nsqadmin using default params.
then i subscribed a topic to two channels by nsq_tail:
then I visit
http://localhost:4171/
, but i saw no topics there.after that, I published a message on topic test by to_nsq:
after about 40 second, the c1 received the message, but c2 didn't.
here is the output of nsq_tail:
c1:
c2:
is it a bug ? i expected to create the topic on subscribing, and i expected to receive messages on publishing.
The text was updated successfully, but these errors were encountered: