-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
KAFKA-3945: Change the type of 'acks' config in console producer to String #1618
Conversation
LGTM |
1 similar comment
LGTM |
.ofType(classOf[java.lang.Integer]) | ||
.defaultsTo(0) | ||
.ofType(classOf[java.lang.String]) | ||
.defaultsTo("0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer need to call toString
in config.requestRequiredAcks.toString
(there are two instances of this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. Thanks for catching those. Will update shortly.
The PR description seems a bit misleading. We talk of validation of valid input, but it seems to me that we don't do any validation apart from setting the type of the parameter (previously |
That's right, what I meant by validation was verifying that the input type is a string and not an integer. I'll try to make this more clear in the description. With the new code, if I provide any input other than those accepted I get this error:
|
…tring The `acks` config that is provided to console producer with `request-required-acks` comes with `all`, `-1`, `0`, `1` as valid options (with `all` and `-1` being interchangeable). Currently, the console producer expects an integer for this input and that makes `all` to become an invalid input. This PR fixes this issue by changing the input type to String.
fba6a2b
to
ec3a78b
Compare
@ijuma The PR was updated. I hope it addresses your concerns. Thanks. |
@ijuma Friendly ping :) |
It would probably be a bit nicer if we didn't print the stacktrace for such cases, but that applies to other parameters too, so perhaps something for another PR. LGTM. |
Merged to trunk. |
The
acks
config that is provided to console producer withrequest-required-acks
comes withall
,-1
,0
,1
as valid options (all
and-1
being interchangeable). Currently, the console producer expects an integer for this input and that makesall
to become an invalid input. This PR fixes this issue by changing the input type to String.