Previous Next JavaScript must be enabled to correctly display this content

## 3 Important Commands

This topic provides the information about the important commands used for Kafka configuration.

View the Topic Configurations

`./kafka-topics.sh --describe --zookeeper zookeeper-server1, zookeeper-server2, zookeeper-server3 --topic topic-name`
Example:

`./kafka-topics.sh --describe --zookeeper localhost:2181, localhost:2182, localhost:2183 --topic structure-closed`

View the Messages Sent from producer-consumer

`./kafka-console-consumer.sh --bootstrap-server Kafka-server1, kafka-server2, kafka-server3 --topic topic-name`
Example:

`./kafka-console-consumer.sh --bootstrap-server localhost:9092, localhost:9093, localhost:9094 --topic structure-closed`

Create Kafka Topics manually

`./kafka-topics.sh --create --bootstrap-server kafka-server1, kafka-server2, kafka-server3 --replication-factor factor-value --partitions partition-value --topic topic-name`
Example:

`./kafka-topics.sh --create --bootstrap-server localhost:9092, localhost:9093, localhost:9094 --replication-factor 3 --partitions 3 --topic structure-closed`

If the topics are created manually before the microservice deployment, then the values in the above command is considered otherwise if we are depending on the microservice deployment then the values configured in the server.properties file of Kafka is considered when the topics are created.

Configurations pertinent to topics have both a server default as well an optional per-topic override. If no per-topic configuration is given the server default is used. The override can be set at topic creation time by giving one or more --config options.