Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> Proper use of ConsumerConnector

Copy link to this message
Re: Proper use of ConsumerConnector
In general, you should use the consumer connector - unless you have a good
reason to load balance and manage offsets manually (which is taken care of
in the consumer connector).
- Does the ConsumerConnector manage connections to multiple brokers,
> or just a single broker?

Multiple brokers.
> - Does the ConsumerConnector require a thread for each partition on
> each broker? (If not, how many threads does it require?)

You can specify how many streams you want - if there are more partitions
than threads, then a given thread can consume from multiple partitions. If
there are more threads than available partitions, there will be idle
> - Does the ConsumerConnector use actual asynchronous IO, or does it
> mimic it by using a dedicated behind-the-scenes thread (and the
> traditional java socket API)?

The consumer connector uses SimpleConsumers for each broker that it
connects to. These consumers fetch from each broker and insert chunks into
blocking queues which the consumer iterators then dequeue.