Produce Kafka Messages with Key-Value Pairs Using Docker - Easy Tutorial!

Опубликовано: 15 Май 2026
на канале: Java Classified with Devops
93
1

In this quick and easy tutorial, learn how to produce Kafka topic messages using key-value pairs with Docker. We’ll walk you through the entire process step by step, from setting up your Docker container to sending messages to Kafka. Whether you're a beginner or looking to refine your skills, this video will help you get up and running fast!

Produce Kafka messages key-value Docker tutorial
Kafka key-value pairs producer with Docker easy tutorial
Kafka producer tutorial key-value pairs Docker setup
Kafka Docker produce messages with key-value pairs
How to produce Kafka messages with key-value Docker tutorial
Kafka key-value message producer Docker easy setup
Produce Kafka messages with Docker and key-value pairs
Kafka key-value producer tutorial with Docker container
Kafka producer Docker key-value pair tutorial
Kafka Docker produce messages with key-value tutorial step by step
Kafka Docker tutorial
Kafka key-value messages
Kafka Spring Boot Docker
Docker Kafka setup
Kafka producer with key
Kafka for beginners
Real-time messaging with Kafka
Kafka key-value pairs
Spring Boot Kafka Docker
Apache Kafka Docker example

#Kafka #Docker #KafkaTutorial #KeyValuePairs #MessageQueue #DevOps #TechTutorial #KafkaProducer #DockerTutorial #KafkaForBeginners #TechTips #SoftwareDevelopment

How to Run the Kafka:
===========================
Step 1 : Create Yaml file with following text which is given below :
version: '3'
services:
zookeeper:
image: bitnami/zookeeper
container_name: zookeeper
ports:
'2181:2181'
environment:
ALLOW_ANONYMOUS_LOGIN: 'yes'
networks:
kafka_nat
kafka:
image: bitnami/kafka
container_name: kafka
ports:
'9092:9092'
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_PLAINTEXT_LISTENER: PLAINTEXT://localhost:9092
depends_on:
zookeeper
networks:
kafka_nat
networks:
kafka_nat:
driver: bridge

Step 2 : Up the Docker compose file using below command:
go to above save file location and run below command :
docker-compose -f docker-compose-file name up

Step 3 : Open another CMD and run below command for checking the running container information.
docker ps

Step 4 : Go to inside the container by using below command :
docker exec -it containerName bash

Step 5 : After inside the container run below command for checking all topics name list.
kafka-topics.sh --list --bootstrap-server kafka:9092

Step 6 : After inside the container run below command for create the topic name.
kafka-topics.sh --create --topic testdemo --bootstrap-server kafka:9092 --partitions 1 --replication-factor 1

Step 7 : Check all the information of the Kafka topics using below command
kafka-topics.sh --describe --topic testdemo --bootstrap-server kafka:9092

Step 8 : Produce the message by using kafka producer command with key and value pair:
kafka-console-producer.sh --topic testdemo --property "parse.key=true" --property "key.separator=:" --bootstrap-server kafka:9092

Then pass the message as key value pair like name: java classified etc

Step 9 : Consume the kafka topic message usinf kafka Consumer command with key value pair :
kafka-console-consumer.sh --topic testdemo --property "print.key=true" --property "print.value=true" --bootstrap-server kafka:9092

#KafkaTutorial #Docker #DevOps #KafkaTopic #DockerCommands #KafkaSetup #QuickGuide #DataStreaming #LearnKafka #TechTips #BigData #SoftwareEngineering #DeveloperLife #KafkaMadeEasy #DockerTips #KafkaOnDocker #ApacheKafka, #Kafka, #KafkaTutorial, #KafkaForBeginners, #Kafka2025, #KafkaSetup, #KafkaInstallation, #KafkaWindows, #KafkaLinux, #KafkaZookeeper, #KafkaDocker, #KafkaWithDocker, #KafkaKafkaBroker, #KafkaAdmin, #KafkaCluster, #KafkaBrokers, #KafkaTopics, #KafkaConsumer, #KafkaProducer, #KafkaStreamAPI, #KafkaStreaming, #KafkaArchitecture, #KafkaMessageQueue, #KafkaQueue, #KafkaMessaging, #KafkaRealTime, #KafkaPipeline, #KafkaIntegration, #KafkaSpringBoot, #KafkaSpringIntegration, #KafkaWithSpring, #KafkaJava, #KafkaMicroservices, #KafkaKafkaLogs, #KafkaLogs, #KafkaMonitoring, #KafkaUI, #KafkaDashboard, #KafkaTools, #KafkaKafdrop, #KafkaKafbat, #KafkaWebUI, #KafkaVisualizer, #KafkaVisualization, #KafkaDataStream, #KafkaLogProcessor, #KafkaEventStreaming, #KafkaEventDriven, #KafkaDeveloper, #KafkaDevOps, #KafkaWithPython, #KafkaNodeJS, #KafkaJS, #KafkaWithGolang, #KafkaWithScala, #KafkaAPIs, #KafkaProducerConsumer, #KafkaOffset, #KafkaPartition, #KafkaReplication, #KafkaRetention, #KafkaLatency, #KafkaPerformance, #KafkaCLI, #KafkaTechStack, #KafkaProduction, #KafkaStreamProcessing, #KafkaEventHandling, #KafkaSystemDesign, #KafkaScalable, #KafkaAsync, #KafkaHighAvailability, #KafkaWalkthrough, #KafkaTutorials, #KafkaSeries2025, #KafkaByExample, #KafkaDeploymentSteps