Update README.md

parent 8abad5d0
# spring-boot-kafka # spring-boot-kafka
This module contains articles about Spring with Kafka
Intro Intro
This is a simple Spring Boot app to demonstrate sending and receiving of messages in Kafka using spring-kafka. This is a simple Spring Boot app to demonstrate sending and receiving of messages in Kafka using spring-kafka.
As Kafka topics are not created automatically by default, this application requires that you create the following topics manually. As Kafka topics are not created automatically by default, this application requires that you create the following topics manually.
`` ```
$ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic kafkaexample $ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic kafkaexample
$ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 5 --topic portitioned $ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 5 --topic portitioned
$ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic filtered $ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic filtered
$ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic greeting $ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic greeting
`` ```
When the application runs successfully, following output is logged on to console (along with spring logs): When the application runs successfully, following output is logged on to console (along with spring logs):
Message received from the 'kafkaexample' topic by the basic listeners with groups test and sample Message received from the 'kafkaexample' topic by the basic listeners with groups test and sample
``
```
Received Message in group 'test': Hello, World! Received Message in group 'test': Hello, World!
Received Message in group 'sample': Hello, World! Received Message in group 'sample': Hello, World!
`` ```
Message received from the 'kafkaexample' topic, with the partition info Message received from the 'kafkaexample' topic, with the partition info
``
```
Received Message: Hello, World! from partition: 0 Received Message: Hello, World! from partition: 0
`` ```
Message received from the 'partitioned' topic, only from specific partitions Message received from the 'partitioned' topic, only from specific partitions
``
```
Received Message: Hello To Partioned Topic! from partition: 0 Received Message: Hello To Partioned Topic! from partition: 0
Received Message: Hello To Partioned Topic! from partition: 3 Received Message: Hello To Partioned Topic! from partition: 3
`` ```
Message received from the 'filtered' topic after filtering Message received from the 'filtered' topic after filtering
``
```
Received Message in filtered listener: Hello Rajesh! Received Message in filtered listener: Hello Rajesh!
`` ```
Message (Serialized Java Object) received from the 'greeting' topic Message (Serialized Java Object) received from the 'greeting' topic
``
```
Received greeting message: Greetings, World!! Received greeting message: Greetings, World!!
`` ```
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment