Skip to the content.

Infrastructure Setup Summary

Date: October 6, 2025 Phase: 0 - Infrastructure Setup Status: ✅ COMPLETE - Ready for Testing


✅ What We’ve Implemented

1. Docker Compose Configuration

File: infrastructure/docker/docker-compose-infrastructure.yml

Added two new services:

Kafka (Port 9092, 9094)

Kafka UI (Port 8090)

2. Infrastructure Scripts Updated

File: scripts/check-infrastructure.sh

Added status checks for:

3. Documentation Updated

File: infrastructure/docker/README.md

Added:


🚀 How to Start Kafka

Start All Infrastructure

cd /home/subramani/modern-reservation
bash infra.sh start

Check Status

bash infra.sh status

Expected Output:

┌─────────────────────┬────────────┬─────────────┬────────────────────────────────┐
│ Service             │ Status     │ Port        │ Details                        │
├─────────────────────┼────────────┼─────────────┼────────────────────────────────┤
│ kafka               │ DOCKER     │ 9092        │ Broker ready                   │
│ kafka-ui            │ DOCKER     │ 8090        │ Monitoring ready               │
└─────────────────────┴────────────┴─────────────┴────────────────────────────────┘

🔍 Access Points

Kafka UI (Monitoring Dashboard)

Kafka Broker (Programmatic Access)


✅ Verification Tests

Test 1: Check Containers Running

docker ps | grep kafka

# Should show 2 containers:
# modern-reservation-kafka
# modern-reservation-kafka-ui

Test 2: Check Kafka Broker Health

docker exec modern-reservation-kafka kafka-broker-api-versions.sh \
  --bootstrap-server localhost:9092

# Should show Kafka broker API versions

Test 3: List Topics

docker exec modern-reservation-kafka kafka-topics.sh \
  --bootstrap-server localhost:9092 \
  --list

# Initially empty (no topics yet)

Test 4: Create Test Topic

docker exec modern-reservation-kafka kafka-topics.sh \
  --bootstrap-server localhost:9092 \
  --create --topic test-topic \
  --partitions 3 \
  --replication-factor 1

# Should show: Created topic test-topic

Test 5: Describe Topic

docker exec modern-reservation-kafka kafka-topics.sh \
  --bootstrap-server localhost:9092 \
  --describe --topic test-topic

# Should show topic configuration with 3 partitions

Test 6: Send Test Message

echo "Hello Kafka!" | docker exec -i modern-reservation-kafka \
  kafka-console-producer.sh \
  --bootstrap-server localhost:9092 \
  --topic test-topic

# Message sent successfully

Test 7: Consume Test Message

docker exec modern-reservation-kafka kafka-console-consumer.sh \
  --bootstrap-server localhost:9092 \
  --topic test-topic \
  --from-beginning \
  --max-messages 1

# Should display: Hello Kafka!

Test 8: View in Kafka UI

  1. Open http://localhost:8090
  2. Click on “modern-reservation” cluster
  3. Go to “Topics”
  4. Find “test-topic”
  5. Click “Messages”
  6. See “Hello Kafka!” message

Test 9: Delete Test Topic

docker exec modern-reservation-kafka kafka-topics.sh \
  --bootstrap-server localhost:9092 \
  --delete --topic test-topic

# Clean up test topic

📊 Infrastructure Summary

Services Now Running

Service Container Port Status
Zipkin modern-reservation-zipkin 9411 ✅ Running
PostgreSQL modern-reservation-postgres 5432 ✅ Running
pgAdmin modern-reservation-pgadmin 5050 ✅ Running
Redis modern-reservation-redis 6379 ✅ Running
Kafka modern-reservation-kafka 9092, 9094 ✅ NEW
Kafka UI modern-reservation-kafka-ui 8090 ✅ NEW

Resource Usage


🎯 What’s Next: Phase 1

Objective: Create Shared Event Library

Timeline: Day 2 (3-6 hours)

Tasks:

  1. Create event package structure in libs/shared/backend-utils
  2. Create BaseEvent.java abstract class
  3. Create EventPublisher.java utility
  4. Create ReservationCreatedEvent.java
  5. Build and install shared library

Location:

libs/shared/backend-utils/src/main/java/com/modernreservation/shared/
└── events/
    ├── BaseEvent.java
    ├── EventPublisher.java
    └── reservation/
        └── ReservationCreatedEvent.java

Next Command:

cd /home/subramani/modern-reservation/libs/shared/backend-utils
# Create event classes (see IMPLEMENTATION_PLAN.md for code)
mvn clean install

🔧 Troubleshooting

Kafka Container Won’t Start

# Check logs
docker logs modern-reservation-kafka

# Common fix: Remove volumes and restart
docker-compose -f infrastructure/docker/docker-compose-infrastructure.yml down -v
docker-compose -f infrastructure/docker/docker-compose-infrastructure.yml up -d

Kafka UI Not Accessible

# Check container status
docker ps | grep kafka-ui

# Check logs
docker logs modern-reservation-kafka-ui

# Verify Kafka is healthy first
docker exec modern-reservation-kafka kafka-broker-api-versions.sh \
  --bootstrap-server localhost:9092

Health Check Failing

# Wait 30 seconds for start_period
sleep 30

# Then check health
docker inspect modern-reservation-kafka | grep -A 10 Health

📝 Files Modified

Created/Modified

  1. infrastructure/docker/docker-compose-infrastructure.yml - Added Kafka + Kafka UI
  2. scripts/check-infrastructure.sh - Added Kafka health checks
  3. infrastructure/docker/README.md - Updated documentation

Ready for Next Phase


✅ Success Criteria - Phase 0


🎉 Ready to Proceed

Phase 0 is complete in code!

Next Action: Start the infrastructure and verify Kafka is running:

cd /home/subramani/modern-reservation
bash infra.sh start
bash infra.sh status

Then open http://localhost:8090 to see Kafka UI!


Phase: 0/4 Complete ✅ Next: Phase 1 - Shared Event Library Estimated Time to Complete Phase 1: 3-6 hours