Skip to content

WesleyJSO/microservices-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

microservices-kafka

  1. About
  2. Download and configuration
  3. Start Zookeper and Kafka

This repo was created to practice and learn about Apache Kafka and microservices arctecture. To maintain it simple, I'm only using Apache Maven and running the project on Java 11.

Apart from downloading the Github repository, this project needs Apache Kafka binaries after the download, unpack and open the Kafka folder and start the Zookeeper and Kafka. Open the command line (I'm using git bash).

The following list of commands will help to start Zookeeper and Kafka.

to start zookeper with default properties file

bin/zookeper-server-start.sh config/zookeper.properties

to start Kafka with default properties file (it needs to have Zookeeper already running)

bin/kafka-server-start.sh config/server.properties

to see all topics options use

bin/kafka-topics.sh

to create a new topic

bin/kafka-topics.sh --create --bootstrap-server localhost:9092 replication-factor 1 --partirions 1 --topic NOME_TOPICO

to start a producer to send messages

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic LOJA_NOVO_PEDIDO

to show all messages from a topic and keep listening

bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic NOME_TOPICO --from-beginning

to describe every topic created

bin/kafka-topics.sh --bootstrap-server localhost:9092 --describe

to change a topic partition size

bin/kafka-topics.sh --alter --zookeeper localhost:2181 --topic [TOPIC_NAME] --partitions [NUMBER_OF_PARTITIONS]

to show consumers status

bin/kafka-consumer-groups.sh -all-groups --boostrap-server localhost:9092 --describe

It is important to notice that the Java JDK version needed to run the commands above is 1.8.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages