Secrets of Kafka console producers

Do Kafka console producers can also create topics? Tricky Interview Ques.

Do Kafka console producers can also create topics?

— Yes, it is possible but not a good idea to create a topic in this way.

kafka-console-producer.sh --bootstrap-server 127.0.0.1:9092 --topic new_topic

But basically this new_topic does not exist, it is not yet created in Kafka, and what will happen if we send the message?

We have got the warning stating that the Leader is not available. This doesn’t work, so let’s try one more time.

This is the issue in Kafka.

Earlier there was no leader available but the Producers are able to recover from the errors. So it just tried and waited until the leader was available and then produced the message.

Checking the list of topics now.

kafka-topics.sh --zookeeper 127.0.0.1:2181 --list

Is it a good idea to create topics in this way?

No, really it is very bad to create a topic in this way, the problem is we get only one partition count and only one replication factor.

kafka-topics.sh --zookeeper 127.0.0.1:2181 --topic new_topic --describe

Learn how can you create a Topic…

Next →

I am Full Stack Java Developer @ Tata Strive | Get blogs and tutorials related to the (React | Kafka | DevOps) | Follow me on LinkedIn https://www.linkedin.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

8 Important Lessons from 8 Semesters of Teaching Large Scale Application Deployment

The Single Responsibility Principle is not so simple!

Deploying Flutter Apps with Github Actions

Rocket ship taking off simulating our flutter web3 app deployment

Embedding malicious codes/payloads into any file types (method-1)

Python linear regression

HOW KUBERNETES IS USED IN INDUSTRIES AND WHAT USE CASES ARE SOLVED BY KUBERNETES?🤔

How to build a REST API using Golang

Hello World!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sagar Kudu

Sagar Kudu

I am Full Stack Java Developer @ Tata Strive | Get blogs and tutorials related to the (React | Kafka | DevOps) | Follow me on LinkedIn https://www.linkedin.com

More from Medium

How to Dockerize Spring Boot Application

Elasticsearch In Action: Core Data Types

Elasticsearch With Docker: It Was Much Easier Than You Thought.

Log Analysis with PgBadger