Skip to content

ssamparn/kafka-cluster-ssl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka Cluster with SSL

This repo has the infrastructure and code for creating a ssl secured kafka cluster.

Generate the required certs for setting up the ssl secured cluster

  • Navigate to the secrets directory

  • Run the below command

$ cd secrets/
$ sh create-certs.sh
  • Run the docker compose for a ssl secured kafka cluster
$ cd ..
$ docker-compose up

Produce/Consumer Messages in a SSL Secured Environment

  • Produce Messages to the topic.
$ docker exec -it kafka1 bash
$ kafka-console-producer --bootstrap-server localhost:9092 \
--topic test-topic \
--producer.config /etc/kafka/properties/producer.properties
  • Consume Messages from the topic.
$ docker exec -it kafka1 bash
$ kafka-console-consumer --bootstrap-server localhost:9092 \
--topic test-topic \
--from-beginning \
--consumer.config /etc/kafka/properties/consumer.properties
$ docker exec -it kafka1 bash
$ kafka-console-consumer --bootstrap-server localhost:9092 \
--topic library-events \
--from-beginning \
--consumer.config /etc/kafka/properties/consumer.properties