github.com/nsqio/nsq@v1.3.0/apps/to_nsq/README.md (about) 1 # to_nsq 2 3 A tool for publishing to an nsq topic with data from `stdin`. 4 5 ## Usage 6 7 ``` 8 Usage of ./to_nsq: 9 -delimiter string 10 character to split input from stdin (default "\n") 11 -nsqd-tcp-address value 12 destination nsqd TCP address (may be given multiple times) 13 -producer-opt value 14 option to passthrough to nsq.Producer (may be given multiple times, http://godoc.org/github.com/nsqio/go-nsq#Config) 15 -rate int 16 Throttle messages to n/second. 0 to disable 17 -topic string 18 NSQ topic to publish to 19 ``` 20 21 ### Examples 22 23 Publish each line of a file: 24 25 ```bash 26 $ cat source.txt | to_nsq -topic="topic" -nsqd-tcp-address="127.0.0.1:4150" 27 ``` 28 29 Publish three messages, in one go: 30 31 ```bash 32 $ echo "one,two,three" | to_nsq -delimiter="," -topic="topic" -nsqd-tcp-address="127.0.0.1:4150" 33 ```