A reactive Spring Boot microservice built with Java 21, WebFlux, and R2DBC for PostgreSQL integration.
- Reactive Programming: Built with Spring WebFlux and R2DBC
- Real-time Streaming: Server-Sent Events (SSE) for live data updates
- Database Integration: PostgreSQL with Flyway migrations
- CRUD Operations: Full REST API for Foo entities
- Containerized: Docker Compose setup included
- Java 21
- Spring Boot 3.5.5
- Spring WebFlux
- Spring Data R2DBC
- PostgreSQL 16
- Flyway
- Docker
- Java 21+
- Docker & Docker Compose
- Maven 3.6+
-
Start PostgreSQL:
docker-compose up -d
-
Run the application:
./mvnw spring-boot:run
The application will start on http://localhost:8080
GET /foo- List all Foo entitiesPOST /foo- Create new Foo entityDELETE /foo/{id}- Delete Foo entity
GET /foo/stream- Server-Sent Events stream of Foo updates
PostgreSQL database runs on port 1111 with:
- Database:
foo - Username:
postgres - Password:
postgres
Flyway handles database migrations automatically on startup.
./mvnw clean package./mvnw testdocker build -t ms-foo .src/
├── main/java/com/guilhermescherer/msfoo/
│ ├── controller/ # REST controllers
│ ├── dto/ # Data Transfer Objects
│ ├── model/ # Entity models
│ ├── repository/ # R2DBC repositories
│ └── service/ # Business logic
└── main/resources/
├── db/migration/ # Flyway migrations
└── application.properties
This project is licensed under the MIT License.