Commit f3801996 authored by lixiaofang's avatar lixiaofang

auto_vest

parent 96c25e9a
...@@ -23,8 +23,7 @@ from kafka.structs import TopicPartition ...@@ -23,8 +23,7 @@ from kafka.structs import TopicPartition
def kafka_consum(topic_name=None): def kafka_consum(topic_name=None):
topic_name = settings.KAFKA_TOPIC_NAME if not topic_name else topic_name topic_name = settings.KAFKA_TOPIC_NAME if not topic_name else topic_name
consumser_obj = KafkaConsumer(topic_name, auto_offset_reset='largest', consumser_obj = KafkaConsumer(topic_name, bootstrap_servers=[settings.KAFKA_BROKER_LIST], enable_auto_commit=True,
bootstrap_servers=[settings.KAFKA_BROKER_LIST], enable_auto_commit=True,
auto_commit_interval_ms=1, group_id="vest") auto_commit_interval_ms=1, group_id="vest")
consumser_obj.subscribe([topic_name, ]) consumser_obj.subscribe([topic_name, ])
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment