-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature kafka/producer #1
Conversation
*/ | ||
public static void main(String[] args) { | ||
try { | ||
var kafkaPrototypeProducer = new KafkaPrototypeProducer(); |
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.
Why is var used instead of specific type?
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.
There is no need to specify the type as it is comprehensible from the right hand side of the equal sign that this object is an instance of type KafkaPrototypeProducer
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.
I agree, but I think stylistically we should limit the use of var.
This might be personal preference, but i prefer explicity for the types.
* @param message the message received from the client. | ||
*/ | ||
@Override | ||
protected void channelRead0(@NotNull ChannelHandlerContext context, @NotNull String message) { |
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.
Confuised regarding naming, why channelRead0?
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.
This is not up to me as it is an overridden function that belongs to SimpleChannelInboundHandler. See documentation at https://netty.io/4.1/api/io/netty/channel/SimpleChannelInboundHandler.html for more information.
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.
I see, my bad!
No description provided.