Skip to content

Commit

Permalink
disable auto-commit for "consume" command
Browse files Browse the repository at this point in the history
  • Loading branch information
Swen committed Aug 27, 2020
1 parent 5c47dc9 commit d1aed3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion esque/clients/consumer.py
Expand Up @@ -306,13 +306,14 @@ def consume_to_file_ordered(
factory = ConsumerFactory()
for partition in partitions:
consumer = factory.create_consumer(
group_id=group_id + "_" + str(partition),
group_id=group_id,
topic_name=None,
output_directory=None if write_to_stdout else output_directory,
avro=avro,
match=match,
last=last,
initialize_default_output_directory=True,
enable_auto_commit=False,
)
consumer.assign_specific_partitions(topic, [partition])
consumers.append(consumer)
Expand Down Expand Up @@ -386,6 +387,7 @@ def consume_to_files(
avro=avro,
match=match,
initialize_default_output_directory=False,
enable_auto_commit=False,
)
number_consumed_messages = consumer.consume(int(numbers))
consumer.close_all_writers()
Expand Down

0 comments on commit d1aed3c

Please sign in to comment.