You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by "panqingcui@eefung.com" <pa...@eefung.com> on 2014/12/29 02:55:50 UTC

kafka consumer pull

HI, 

I recently learning Kafka, there are several problems 

1, ActiveMQ is broker push message, consumer established the messagelistener gets the message, but the message in Kafka are consumer pull from broker, Timing acquisition from broker    or can build the listener on the broker? 
2, I now have more than one consumer, to consume the same topic, should put them in the same group? 

3, this value should be set to zookeeper.session.timeout.ms how much? 400ms java example, but will appear  Unable to connect to zookeeper server within timeout: 400


panqingcui@eefung.com

Re: kafka consumer pull

Posted by Jun Rao <ju...@confluent.io>.
1. Kafka consumers support long poll. If there is no new message, a fetch
request will block at the broker for up to max.wait.ms,
2. If you want the two consumers to each consume a full set of all
messages, you should put them in different groups. On the other hand, if
you want the two consumers to jointly consume a single copy of all
messages, then they need to be in the same group.
3.  zookeeper.session.timeout.ms is used for failure detection. You can
configure zookeeper.connection.timeout.ms (defaults to
zookeeper.session.timeout.ms) for the connection timeout.

Thanks,

Jun

On Sun, Dec 28, 2014 at 5:55 PM, panqingcui@eefung.com <
panqingcui@eefung.com> wrote:

>
> HI,
>
> I recently learning Kafka, there are several problems
>
> 1, ActiveMQ is broker push message, consumer established the
> messagelistener gets the message, but the message in Kafka are consumer
> pull from broker, Timing acquisition from broker    or can build the
> listener on the broker?
> 2, I now have more than one consumer, to consume the same topic, should
> put them in the same group?
>
> 3, this value should be set to zookeeper.session.timeout.ms how much?
> 400ms java example, but will appear  Unable to connect to zookeeper server
> within timeout: 400
>
>
> panqingcui@eefung.com
>