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

Popular posts from this blog

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -

Asterisk AGI Python Script to Dialplan does not work -