Skip to content

Commit

Permalink
fix: Subscribe to the topic after consumer creation, don't use the co…
Browse files Browse the repository at this point in the history
…nfig hash as it doesn't work that way
  • Loading branch information
Smejky338 committed Dec 12, 2023
1 parent 99339a9 commit d2a9822
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opl/skip_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def doit_seek_to_end(kafka_hosts, kafka_timeout, kafka_topic, kafka_group, args=

# Common parameters for both cases
common_params = {
topics: kafka_topic,
bootstrap_servers: kafka_hosts,
auto_offset_reset: "latest",
enable_auto_commit: True,
Expand Down Expand Up @@ -51,6 +50,8 @@ def doit_seek_to_end(kafka_hosts, kafka_timeout, kafka_topic, kafka_group, args=
)
consumer = KafkaConsumer(**common_params)

consumer.subscribe(kafka_topic)

# Seek to end
for attempt in range(10):
try:
Expand Down

0 comments on commit d2a9822

Please sign in to comment.