Skip to content

Commit

Permalink
Merge pull request #377 from FundingCircle/mc-fix-seek-to-timestamp
Browse files Browse the repository at this point in the history
Retrieve end offsets before searching for offsets for timestamp
  • Loading branch information
marcoccchan authored Aug 16, 2024
2 parents bc35601 + e1cc7fb commit 6448a8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jackdaw/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@
[^Consumer consumer timestamp topics]
(let [topic-partitions (->> (mapcat #(partitions-for consumer %) topics)
(map #(select-keys % [:topic-name :partition])))
end-offsets (end-offsets consumer topic-partitions)
ts-offsets (offsets-for-times consumer
(zipmap topic-partitions
(repeat (count topic-partitions) timestamp)))
end-offsets (end-offsets consumer topic-partitions)
offsets (reduce-kv (fn [m k v]
(assoc m k {:ts-offset v
:end-offset (get end-offsets k)}))
Expand Down

0 comments on commit 6448a8e

Please sign in to comment.