Skip to content

nsqproducer is a wrap for nsq.Producer but using nsqlookupd to find available endpoint

License

Notifications You must be signed in to change notification settings

sryanyuan/nsqproducer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nsqproducer

nsqproducer is a wrap for nsq.Producer but using nsqlookupd to find available endpoint

purpose

nsq.Producer use one nsqd endpoint to publish message.

nsqproducer is a wrap for nsq.Producer, but using nsqlookupd to find all available endpoint.When current using nsqd is unavailable, it will auto search for the next available one.

Once all endpoint is unavailable, it will pull nsqd node list from nsqlookupd again.

usage

nsqlookupdAddrs := []string{"127.0.0.1:4161"}
producer, err := nsqproducer.NewNSQProducer(nsqlookupdAddrs, cfg, &nsqDebugLogger, nsq.LogLevelDebug)
if nil != err {
	return err
}
producer.Publish(topic, body)

About

nsqproducer is a wrap for nsq.Producer but using nsqlookupd to find available endpoint

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages