You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sarama...@googlegroups.com
Hi.
I would like to create a single Producer and share it between workers (goroutines). Is it safe and efficient? Is it better to create many clients/producers?
Regards.
Evan Huus
unread,
Aug 8, 2014, 9:32:59 AM8/8/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sarama...@googlegroups.com
Yes, it should be both safe and efficient.
dh...@udacity.com
unread,
Oct 3, 2014, 7:21:23 PM10/3/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sarama...@googlegroups.com
So does this mean that if a sendMessage in one goroutine is blocking for a given producer, it wont affect that same producer's calls to sendMessage in other goroutines?
Thanks,
Dhruv
Evan Huus
unread,
Oct 3, 2014, 10:53:49 PM10/3/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sarama...@googlegroups.com
Depends on what you mean by "affect" - both messages should absolutely be safely delivered, but I'm not sure the performance impact. There are definitely some synchronization points between the goroutines, but I don't think they wrap any of the major work (specifically the network round-trip) so it should be relatively performant. It won't be as fast as fully-asynchronous producing (with QueueMessage) of course. The best way to find out for sure would be to try it and see :)