Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
spring-boot-kafka
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Venkata Rajesh Kumar Gajjala
spring-boot-kafka
Commits
604bab22
Commit
604bab22
authored
Feb 21, 2020
by
Venkata Rajesh Kumar Gajjala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
8abad5d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
README.md
README.md
+17
-14
No files found.
README.md
View file @
604bab22
# spring-boot-kafka
This module contains articles about Spring with Kafka
Intro
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.
``
``
`
$ 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 1 --topic filtered
$ 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):
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 'sample': Hello, World!
``
``
`
Message received from the 'kafkaexample' topic, with the partition info
``
```
Received Message: Hello, World! from partition: 0
``
``
`
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: 3
``
``
`
Message received from the 'filtered' topic after filtering
``
```
Received Message in filtered listener: Hello Rajesh!
``
``
`
Message (Serialized Java Object) received from the 'greeting' topic
``
```
Received greeting message: Greetings, World!!
``
\ No newline at end of file
```
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment