elodina / dropwizard-kafka-http

Apache Kafka HTTP Endpoint for producing and consuming messages from topics
http://www.elodina.net
Apache License 2.0
154 stars 45 forks source link

need a producer interface that just sends to a resident producer #3

Closed joestein closed 10 years ago

joestein commented 10 years ago

have one instance of a producer and then for the different topic names and partition key something like /producer// and then make the body (like you are saying) be the message.

dmitrypekar commented 10 years ago

Now resource uses a single instance of producer. From kafka sources (kafka.producer.Producer#send) it seems that its safe to use one producer per several threads. Producer now operates always in async mode. In other case one HTTP produce request will block others. Remove POST async parameter.

mrtheb commented 10 years ago

Just a note: it is safe to use a single producer across threads because it is threadsafe but, depending on your load, you'll hit a bottleneck if you don't use a pool. At least, that's what I found.