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)是等待消息到来的最长时间。

  • 相关阅读:
    最长连续子序列(dp,分而治之递归)
    判断线段是否相交
    1840: Jack Straws
    5065: 最长连续子序列
    TZOJ 4493: Remove Digits
    TZOJ 5271: 质因数的个数
    2019年天梯赛
    PTA 树的遍历
    TZOJ:3660: 家庭关系
    PTA 复数四则运算
  • 原文地址:https://www.cnblogs.com/ryu-manager/p/9443336.html
Copyright © 2011-2022 走看看