This project demonstrates a microservices architecture with the following components:
api-gateway: Central entry point using Spring Cloud and Redis, supports dynamic routing, load balancing and rate limitingeureka-server: Service registry and discovery using Netflix Eurekaorganization-service: Manages organizations, exposes REST endpoints, and is called via FeignClientevent-service: Manages events, communicates asynchronously via RabbitMQnews-service: Consumes event messages and exposes a GraphQL API for querying news
- Java 17+
- Docker & Docker Compose
- Clone this repo
git clone git@github.com:seraaaaaaaa/spring-microservices.git
cd spring-microservices
- Build JARs using the provided script:
-
On Windows:
build.bat -
On Linux/macOS:
build.sh
- Start all services using Docker Compose:
docker-compose up --build
- Access the services:
| Service | URL |
|---|---|
| API Gateway | http://localhost:8080 |
| Eureka Dashboard | http://localhost:8761 |
| RabbitMQ UI | http://localhost:15672 |
-
All services register themselves with Eureka.
-
The
event-serviceuses FeignClient to communicate with theorganization-serviceby service name. -
When an event is created, a message is sent to RabbitMQ.
-
The
news-servicelistens for incoming messages and creates a related news entry. -
External requests go through the API Gateway, which manages routing, load balancing, and rate limiting with Redis.
This project is available as open source under the terms of the MIT License.
