Apache kafka 在卡夫卡中批量处理大量数据?

Apache kafka 在卡夫卡中批量处理大量数据?,apache-kafka,kafka-consumer-api,Apache Kafka,Kafka Consumer Api,我正在使用以下配置我的消费者 几乎是直接从融合的文档中提取的。我担心的是,我传入的字节数(500mb)超过了整数的大小。可能是一个愚蠢的问题,但是我可以配置消费者属性来接受long或其他什么吗?获取错误,因为值太大 文档看起来是无界的,但类型是int,因此不确定这是如何实现的: max.partition.fetch.bytes: The maximum amount of data per-partition the server will return. Records are fetche

我正在使用以下配置我的消费者

几乎是直接从融合的文档中提取的。我担心的是,我传入的字节数(500mb)超过了整数的大小。可能是一个愚蠢的问题,但是我可以配置消费者属性来接受long或其他什么吗?获取错误,因为值太大

文档看起来是无界的,但类型是
int
,因此不确定这是如何实现的:

max.partition.fetch.bytes: The maximum amount of data per-partition the server will return. Records are fetched in batches by the consumer. If the first record batch in the first non-empty partition of the fetch is larger than this limit, the batch will still be returned to ensure that the consumer can make progress. The maximum record batch size accepted by the broker is defined via message.max.bytes (broker config) or max.message.bytes (topic config). See fetch.max.bytes for limiting the consumer request size.

    Type: int
    Default: 1048576
    Valid Values: [0,...]
    Importance: high

首先要弄清楚:java中的最大int值是2147483647

2147483647字节≈ 2.15 gb

其次,当您检查KafkaConsumer API的源代码时,您将看到MAX_PARTITION_FETCH_BYTES_CONFIG参数被转换为整数。因此,不可能将其设置为大于整数上限的值。这是一种设计决策,不能改变

源代码链接:


首先要明确一点:java中的最大int值是2147483647

2147483647字节≈ 2.15 gb

其次,当您检查KafkaConsumer API的源代码时,您将看到MAX_PARTITION_FETCH_BYTES_CONFIG参数被转换为整数。因此,不可能将其设置为大于整数上限的值。这是一种设计决策,不能改变

源代码链接:


消息的最大大小为1mb默认值…消息的最大大小为1mb默认值。。。