nsqio / go-nsq

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

Is there a way to set a channel/topic from a client using TCP? #242

Closed JoseFMP closed 5 years ago

JoseFMP commented 5 years ago

Using the HTTP API I can set a topic in nsqd:

$ curl -X POST http://127.0.0.1:4151/topic/create?topic=name

I can also create a channel:

$ curl -X POST http://127.0.0.1:4151/channel/create?topic=name&channel=name

Now I am wondering. Is it possible to do the same thing from a client using the TCP Protocol? If thus, then the library go-nsq is useless for this purpose. Correct?

mreiferson commented 5 years ago

Yes, there is no functionality in go-nsq to do that explicitly. However, publishing to a topic will create it if it does not yet exist, and subscribing to a topic will create a channel if it does not already exist.