Commit 2b75f5e3 authored by lixiaofang's avatar lixiaofang

auto_vest

parent 2f0a0f45
......@@ -21,11 +21,9 @@ from follow.views.follow_fun import follow
def kafka_consum(topic_name=None):
topic_name = settings.KAFKA_TOPIC_NAME if not topic_name else topic_name
consumser_obj = KafkaConsumer(topic_name, bootstrap_servers=[settings.KAFKA_BROKER_LIST], enable_auto_commit=False,
consumser_obj = KafkaConsumer(topic_name, bootstrap_servers=[settings.KAFKA_BROKER_LIST], enable_auto_commit=True,
auto_commit_interval_ms=100, group_id="vest")
consumser_obj.subscribe([topic_name, ])
consumser_obj.seek()
try:
while True:
msg_dict = consumser_obj.poll(timeout_ms=100, max_records=50)
......
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