Skip to content

kristian-schjelderup/kafkademo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafkademo

A small Java SpringBoot based application using Kafka to produce and consume a message with JSON payload.

Prerequisites

Install Confluent CLI from here: https://docs.confluent.io/confluent-cli/current/install.html

Usage

1. Start a local kafka broker through the use of Confluent CLI

confluent local kafka start

Take note of the port used by Kafka broker as it starts up. The output will be on this form:

+-----------------+-------+
| Kafka REST Port | 8082  |
| Plaintext Ports | 62082 |
+-----------------+-------+

2. Run application

First modify src/main/resources/applicatipn.properties with correct port

Then start application

./gradlew bootRun

3. Send some message

The application has a REST API to publish messages.

curl -XPOST "https://localhost:8080/send?message=test"

4. Watch output

The output from the application will list received messages.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages