[
https://issues.apache.org/jira/browse/STORM-2992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16550722#comment-16550722
]
Stig Rohde Døssing commented on STORM-2992:
-------------------------------------------
[~jingc] I noticed that you've already raised an issue for Kafka to provide an
implementation for this, so resolving that would be the nicest solution.
If you don't want to wait for Kafka, we aren't chained to using MockConsumer.
You can provide any implementation of Consumer you like for the tests. This
means you could use a partial mock to implement offsetsForTimes in your test.
See
https://static.javadoc.io/org.mockito/mockito-core/2.19.1/org/mockito/Mockito.html#16.
Just wrap the MockConsumer with a spy, and provide your own offsetsForTimes
implementation in the test.
If you decide to go with the partial mocking route, I'd like to see an issue
raised to remove the partial mocking again once the Kafka issue is resolved.
> Add support for starting storm-kafka-client spout consumer at a specific
> timestamp
> -----------------------------------------------------------------------------------
>
> Key: STORM-2992
> URL: https://issues.apache.org/jira/browse/STORM-2992
> Project: Apache Storm
> Issue Type: Improvement
> Affects Versions: 2.0.0
> Reporter: Stig Rohde Døssing
> Assignee: Jing Chen
> Priority: Minor
>
> The 0.10.1.0 KafkaConsumer has support for getting the offset corresponding
> to a given timestamp (the offsetsForTimes method). We could provide a new
> FirstPollOffsetStrategy to allow topologies to start consumption at a
> specific timestamp, instead of earliest or latest offset.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)