zoukankan      html  css  js  c++  java
  • kafka producer.poll producer.flush consumer.poll的区别

    参考文献:https://docs.confluent.io/current/clients/confluent-kafka-python/index.html#consumer

    • Producer.poll(timeout)

      timeout (float) – Maximum time to block waiting for events. (Seconds)

      Polls the producer for events and calls the corresponding callbacks (if registered).

    • Producer.flush()

      Wait for all messages in the Producer queue to be delivered. This is a convenience method that calls poll() until len() is zero or the optional timeout elapses.

    • Producer.poll()和Producer.flush()的区别:

      flush确保所有meg都传送给broker,对poll的不停调用直到len(Number of messages and Kafka protocol requests waiting to be delivered to broker)为0.

    • Consumer.poll(timeout): 

      Consume messages, calls callbacks and returns events.

      作用是取数据,传入的参数:timeout (float) – Maximum time to block waiting for message, event or callback. (Seconds)是等待消息到来的最长时间。

  • 相关阅读:
    几种常见排序算法
    62.Android之各分辨率定义的图片规格
    MVC
    EasyUI datebox 只读和取值
    WebForm带有图片的验证码
    WebForm水印照片
    ajax完整结构
    jquery简单动画
    webform数据导出
    WebForm 发送邮箱
  • 原文地址:https://www.cnblogs.com/ryu-manager/p/9443336.html
Copyright © 2011-2022 走看看