Case study 03 / 04
- Type
- Microservices
- Year
- Ongoing
- Status
- Open source
- Core stack
- Java 17, Spring Boot, Spring Cloud Gateway
01Overview
Overview
A distributed chat system made of Spring Boot microservices on Kubernetes. Messages enter through a gateway, move through WebSocket and Kafka-driven services and fan out across instances through Redis.
Message latency
Concurrent connections
Independent services
02The problem
Real-time chat needs reliable, ordered delivery and persistent connections for hundreds of users, without hammering the database on every single message.
03The approach
ConvoMesh splits connection handling, routing, caching and persistence into separate services, so delivery scales without tight coupling. Spring Cloud Gateway is the single entry point for HTTP and WebSocket traffic, Kafka is the event backbone and Redis carries messages between WebSocket replicas.
04How it works
How a message travels
- 01
Enter
Spring Cloud Gateway is the single entry point for every external HTTP and WebSocket request.
- 02
Connect
The WebSocket service holds STOMP and SockJS sessions and runs as multiple replicas.
- 03
Stream
Chat events are published to Kafka and consumed by the notification service, which coordinates the broadcast.
- 04
Fan out and persist
Redis pub/sub delivers each message to every WebSocket instance, so users on different replicas still meet. PostgreSQL keeps the history.
05Under the hood
Under the hood
01
Five services, one contract
Gateway on 8080, auth on 8081, chat on 8082, WebSocket on 8083 and notifications on 8084, backed by PostgreSQL, Redis, ZooKeeper and Kafka.
02
Self-healing on Kubernetes
Runs on Minikube or Docker Compose. Delete a pod in the middle of a conversation and Kubernetes brings it straight back.
03
Sync and async side by side
Synchronous APIs and asynchronous event pipelines in one system: a realistic playground for networking, service discovery, restarts and rollouts.
06Stack
Technology stack
- Java 17
- Spring Boot
- Spring Cloud Gateway
- Spring WebSocket
- STOMP / SockJS
- Apache Kafka
- Redis
- PostgreSQL
- Docker
- Kubernetes
- Minikube