Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.
Sarama Version:1.1.0.1
Kafka Version:0.10.1.0
Go Version:1.6
the latest version of kafka supports retrieving offsets by timestamp. Is this supported by sarama.
Also does sarama support storing time stamp as supported in new kafka java client .
https://kafka.apache.org/0101/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#offsetsForTimes(java.util.Map)
What configuration values are you using for Sarama and Kafka?
When filing an issue please provide logs from Sarama and Kafka if at all
possible. You can set sarama.Logger to a log.Logger to capture Sarama debug
output.
the latest version of kafka supports retrieving offsets by timestamp. Is this supported by sarama.
Starting in Sarama v1.11.0, the method Client.GetOffset() will automatically use the new precise timestamp fetching if your Config.Version is at least kafka version 0.10.1.
Also does sarama support storing time stamp as supported in new kafka java client .
Yes, this works as of Sarama v1.10.0, though there are some bugs in that version when using timestamps with compression. v1.11.0 should work in all cases.
thanks for your reply. Just one more question. Assuming a topic has only one partition .
Say for suppose if messages are published and the current offset is 10.
But consumption is done till 5th offset which is the latest consumed offset.
Suppose i want to replay the subscriber from offset 2 . how can i do that in sarama ?
Sarama config was supporting only the latestoffset and oldestoffset. How do i reset to a particular offset and start from there. Is there a way i can do that ?
It's not clear if you're referring to the Consumer or the OffsetManager. With the consumer, all you have to do is close the existing PartitionConsumer and then call ConsumePartition again: the third parameter to that method accepts specific offsets.
The offset manager does not support replaying at this time (see https://github.com/Shopify/sarama/issues/554)
Most helpful comment
Starting in Sarama v1.11.0, the method
Client.GetOffset()will automatically use the new precise timestamp fetching if yourConfig.Versionis at least kafka version 0.10.1.Yes, this works as of Sarama v1.10.0, though there are some bugs in that version when using timestamps with compression. v1.11.0 should work in all cases.