简体   繁体   English

我如何使用kafka-python成为批处理使用者?

[英]How can I make a batch consumer with kafka-python?

I've been looking for a while but I can't find a way to create a batch consumer with kafka-python . 我已经寻找了一段时间,但找不到使用kafka-python创建batch consumer的方法。 I found a guide for Java but it isn't exactly what I am trying to achieve. 我找到了Java指南,但这并不是我想要达到的目的。 Indeed, my goal is just to consume a fixed number of records let's say and process them (perform some transformations) and after that, store them into a Database. 确实,我的目标只是消耗固定数量的记录,比如说要处理它们(执行一些转换),然后将它们存储到数据库中。

this is one consumer argument: 这是一个消费者论点:

max_poll_records (int) – The maximum number of records returned in a single call to poll(). max_poll_records(int)–一次调用poll()时返回的最大记录数。 Default: 500 默认值:500

i think kafka-python can do batch consume with a max number of records, maybe not exactly what your saying a fixed number. 我认为kafka-python可以使用最大数量的记录进行批处理消耗,也许不完全是您所说的固定数量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM