Kafka Producer Timestamp -




i'm having trouble understanding producerrecord.

previously constructing producerrecord this:

new producerrecord<string, string>("my-topic", "key", "value") 

i'd pass in timestamp additionally decided check docs , found out constructor indeed allows passing timestamp. required specifying partition this:

new producerrecord(string topic,               integer partition,               long timestamp,               k key,               v value) 

i'm confused pass partition parameter since previous constructor used handling me.

you can use still constructor without problem. have pass partition null in constructor , still defaultpartitioner take care partitioner assignment. name sure using new kafkaproducer api. timestamp doesn't work old scala based producer.





wiki

Comments