Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageMaxBytes and CompressionType - MessageMaxBytes is enforced BEFORE compression #2326

Open
sztrzask opened this issue Oct 15, 2024 · 0 comments

Comments

@sztrzask
Copy link

Description

MessageMaxBytes doesn't respect CompressionType - it checks message size BEFORE compression. Is there a reason or just stupid implementation?

If this behaviour is originating in librdkafka I'll happily publish it there.

How to reproduce

set
config.CompressionType = CompressionType.Lz4;

create an arbitrarily large message -
var numberOfCharacters = 3 * 1024 * 1024 / 2;
string largeString = new string('A', numberOfCharacters); // size will be 1.5 MB

and send it via Kafka.
The Producer will fail informing you that the message size is too large. Compressed message fits the limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant