Skip to content

Conversation

@paulojmdias
Copy link
Member

@paulojmdias paulojmdias commented Dec 4, 2025

Description

The franz-go Kafka consumer was using default_fetch_size (a Sarama-specific setting) instead of max_fetch_size when configuring kgo.FetchMaxBytes.

This fix ensures the parameter max_fetch_size is used and adds validation to prevent it from being less than min_fetch_size.

The default value for max_fetch_size has been changed from 0 (unlimited) to 1048576 (1 MiB) to maintain backward compatibility with the previous behavior. The default for franz-go is 50MiB.

The default_fetch_size parameter is now marked as deprecated for franz-go and will only be used with the legacy Sarama client.

Link to tracking issue

Fixes #43104

Testing

Added tests to ensure max_fetch_size is equal to or higher than min_fetch_size.

Documentation

Updated documentation referring to the default_fetch_size is deprecated.

@paulojmdias
Copy link
Member Author

@axw IdK if we should set the default value the same as franz-go, which is 50MiB.

At the same time, I added the validation about max_fetch_size being equal to or higher than min_fetch_size, but also want your input about it.

Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @paulojmdias, looks good - just a few things

Copy link
Contributor

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks.

@atoulme
Copy link
Contributor

atoulme commented Dec 8, 2025

Approved by codeowner, LGTM, merging.

@atoulme atoulme merged commit 08a4be9 into open-telemetry:main Dec 8, 2025
189 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 8, 2025
@paulojmdias paulojmdias deleted the fix/43104 branch December 9, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/kafka] max_fetch_size consumer option is not used in franz-go

4 participants