Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Each subdirectory in this repository represents a specific integration or featur

Below you will find a summary table of each subproject. For more details, please refer to the individual README.md files.

| Name | Description |
|----------------------------------------------------|-------------------------------------------------------------------------------|
| [Spring Boot + Kafka](./spring-kafka-example) | Demonstrates a basic integration between Spring Boot and Apache Kafka. |
| Name | Description |
|-----------------------------------------------|------------------------------------------------------------------------|
| [Spring Boot + Kafka](./spring-kafka-example) | Demonstrates a basic integration between Spring Boot and Apache Kafka. |

---

Expand Down
25 changes: 25 additions & 0 deletions spring-kafka-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# spring-kafka-example

---

## Overview

Basic Java Spring (Java 21) project showing simple integration with Apache Kafka.
Includes a Kafka producer and consumer with minimal setup for local development.

Comment thread
igorcampos-dev marked this conversation as resolved.
---

## Tech stack

- Spring Boot
- Java 21
- Kafka (Docker)

Comment thread
igorcampos-dev marked this conversation as resolved.
---

## Related Resources

| Description | Link |
|--------------------------------------------------|------------------------------------------------------------------------------------------------------------|
| Spring Kafka Official Docs | [spring.io/projects/spring-kafka](https://spring.io/projects/spring-kafka) |
| Various Kafka setups and approaches using Docker | [github.com/conduktor/kafka-stack-docker-compose](https://github.com/conduktor/kafka-stack-docker-compose) |
23 changes: 23 additions & 0 deletions spring-kafka-example/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
services:

server:
build:
context: .
Expand All @@ -8,3 +9,25 @@ services:
SERVER_PORT: "80"
SPRING_PROFILES_ACTIVE: "default"

zookeeper:
image: confluentinc/cp-zookeeper:7.4.0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- '2181:2181'
Comment thread
igorcampos-dev marked this conversation as resolved.

kafka:
image: confluentinc/cp-kafka:7.4.0
depends_on:
- zookeeper
ports:
- '9092:9092'
- '29092:29092'
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
Comment thread
igorcampos-dev marked this conversation as resolved.
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1