java - Two Kafka consumers causing odd behavior with one another -
i have 2 consumers different client id's , group id's. aside retention hour , max partitions, kafka installation contains default configuration. i've looked around see if else has had same issue can't pull results.
so scenario goes this:
consumer a: connects kafka, consumes 3 million messages need consumed, , sits idle waiting more messages.
consumer b: different client / group id, connects same kafka topic, , causes consumer repeat of 3 million messages while consumer b consumes them well.
the 2 consumers 2 different java applications different client , group id's running on same computer. kafka server on computer.
is normal behavior in kafka? @ complete loss.
here consumer config:
bootstrap.servers=192.168.110.109:9092 acks=all max.block.ms=2000 retries=0 batch.size=16384 auto.commit.interval.ms=1000 linger.ms=0 key.deserializer=org.apache.kafka.common.serialization.stringdeserializer value.deserializer=org.apache.kafka.common.serialization.stringdeserializer block.on.buffer.full=true enable.auto.commit=false auto.offset.reset=none session.timeout.ms=30000 zookeeper.session.timeout=100000 rebalance.backoff.ms=8000 group.id=consumergroupa zookeeper.connect=192.168.110.109:2181 poll.interval=100
and obvious difference in consumer b group.id=consumergroupb
this correct behavior. because based on configs, consumers don't commit offset of records have read!
when consumer read record, must commit reading it, can ensure consumers commit offsets automatically setting enable.auto.commit=true
or commit each record manually. in case think auto commit fine you.
Comments
Post a Comment