kafka-php icon indicating copy to clipboard operation
kafka-php copied to clipboard

Lost first message when start consumer

Open SolarZi opened this issue 7 years ago • 6 comments

before i start the kafka consumer ,i use kafka shell get kafka topic consumption progress

TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
test 0 212 213 1 - - -

then i start the kafka consumer,i got this info

consoler_logger_kafka.DEBUG: Get current fetch offset sucess, result: [{"topicName":"test","partitions":[{"partition":0,"errorCode":0,"metadata":"","offset":212}]}] [] []
consoler_logger_kafka.DEBUG: Start Request ClientId: kafka-php ApiKey: HeartbeatRequest  ApiVersion: 0 [] []
consoler_logger_kafka.DEBUG: Start Request ClientId: kafka-php ApiKey: OffsetRequest  ApiVersion: 0 [] []
consoler_logger_kafka.DEBUG: Fetch message start, params:{"max_wait_time":100,"replica_id":-1,"min_bytes":"1000","data":[{"topic_name":"test","partitions":[{"partition_id":0,"offset":213,"max_bytes":65536}]}]} [] []
consoler_logger_kafka.DEBUG: Start Request ClientId: kafka-php ApiKey: FetchRequest  ApiVersion: 2 [] []
consoler_logger_kafka.DEBUG: Start Request ClientId: kafka-php ApiKey: OffsetFetchRequest  ApiVersion: 1 [] []

The Get current fetch offset return offset is 212, Fetch message params offset is 213 Is this cause lost one message?

SolarZi avatar Aug 08 '18 09:08 SolarZi

i got the same problems in tag2.0.8.0, so i fix it by myself in local repository.

The official team do not do any thing about it.....

so sad!!!!

zmisgod avatar Aug 14 '18 03:08 zmisgod

@zmisgod, have you considered creating a PR?

Sevavietl avatar Aug 14 '18 03:08 Sevavietl

@Sevavietl yes ,i try to pull request for tag v2.0.8.0, but ......

image

zmisgod avatar Aug 14 '18 03:08 zmisgod

@zmisgod that is good,thank u for your kindness. Finally,i have to use rdkafka

SolarZi avatar Aug 15 '18 08:08 SolarZi

I am also facing same issue..whenever we start consumer..it always lost the first message...

purab avatar Oct 04 '18 17:10 purab

The same problem ...

jiangqiang avatar Oct 11 '18 09:10 jiangqiang