-
Notifications
You must be signed in to change notification settings - Fork 643
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
Consumer max_bytes
param does not return any messages if too small
#111
Comments
I have also been looking at this functionality to support long polling. I think the behaviour that you describe above is as per "spec" in that to send a larger message through Kafka Rest would have to exceed the max message you have specified. The tests certainly seem to back that up. Would be great if one of the core maintainers comment on this... Having said that, its rather inconvenient as I want the same behaviour that you describe - a sort of byte threshold rather than max. Finally, when investigating this I have discovered a bug. The following code is the loop that handles reading messages from kafka. The loop correctly breaks when the max bytes is exceeded.
But then later on the check to determine if the processing of messages has finished the check fails to take into account the roughMsgSize and so will not call finish. The only way finish can be called is for the timeout to elapse. So, for a long poll example of 30s the messages won't be picked up until that 30s has elapsed...
I'll be submitting a patch to fix this particular issue in the next few days. Thanks, |
If
max_bytes
is set smaller than the size of a single message, it will return zero messages. Example:Expected: Should return a single message.
The text was updated successfully, but these errors were encountered: