Closed zhoushuguang closed 4 years ago
Use the latest version 1.0.8
[nsqd] 2020/03/15 23:00:32.128869 INFO: TCP: new client(127.0.0.1:54444)
[nsqd] 2020/03/15 23:00:32.128895 INFO: CLIENT(127.0.0.1:54444): desired protocol magic ' V2'
[nsqd] 2020/03/15 23:00:32.129194 INFO: [127.0.0.1:54444] IDENTIFY: {ClientID:zhoushuangde Hostname:zhoushuang HeartbeatInterval:30000 OutputBufferSize:16384 OutputBufferTimeout:250 FeatureNegotiation:true TLSv1:false Deflate:false DeflateLevel:6 Snappy:false SampleRate:0 UserAgent:go-nsq/1.0.8 MsgTimeout:0}
[nsqd] 2020/03/15 23:00:32.130378 INFO: PROTOCOL(V2): [127.0.0.1:54444] exiting ioloop
[nsqd] 2020/03/15 23:00:32.130413 INFO: PROTOCOL(V2): [127.0.0.1:54444] exiting messagePump
Please use "fenced code blocks" for both code samples and terminal or log output, see https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks
I don't see errors in what you pasted, I see typical logging output.
Maybe you want to set the logging level so that only warnings and errors are logged? Something like:
producer, err := nsq.NewProducer("127.0.0.1:4150", config)
if err != nil {
panic(err)
}
producer.SetLogger(log.New(os.Stderr, "", log.Flags()), nsq.LogLevelWarning)
@ploxiln thanks, I misunderstood
run the code