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

Feature kafka/producer #1

Merged
merged 20 commits into from
Feb 20, 2022
Merged

Feature kafka/producer #1

merged 20 commits into from
Feb 20, 2022

Conversation

Klungerbo
Copy link
Collaborator

No description provided.

*/
public static void main(String[] args) {
try {
var kafkaPrototypeProducer = new KafkaPrototypeProducer();
Copy link
Collaborator

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?

Copy link
Collaborator Author

@Klungerbo Klungerbo Feb 20, 2022

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

Copy link
Collaborator

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) {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, my bad!

@larsramberg larsramberg merged commit 5c6fe4f into develop Feb 20, 2022
@Klungerbo Klungerbo deleted the feature_kafka/producer branch February 28, 2022 20:28
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

Successfully merging this pull request may close these issues.

2 participants