confluentinc / librdkafka

The Apache Kafka C/C++ library
Other
319 stars 3.16k forks source link

Message timestamp type is incorrect for produced message #2368

Closed TinkerBell-xdd closed 4 years ago

TinkerBell-xdd commented 5 years ago

Description

For topic configured with message.timestamp.type=LogAppendTime, the message timestamp type of produced message is 8, which should be 2.

I noticed there is a potential buggy assignment code in function: rd_kafka_handle_Produce

rkm->rkm_tstype = RD_KAFKA_MSG_ATTR_LOG_APPEND_TIME;

It seem the value assigned should be RD_KAFKA_TIMESTAMP_LOG_APPEND_TIME, instead of RD_KAFKA_MSG_ATTR_LOG_APPEND_TIME.

Could you help confirm my suspicion?

Thanks

edenhill commented 5 years ago

You are right! Want to submit a PR?

jediMunees commented 4 years ago

Hi @edenhill , Please find the pull request https://github.com/edenhill/librdkafka/pull/2664 for the changes proposed by TinkerBell-xdd.