A simple Spring Boot microservice used as a shared dependency across POC repositories (Kong, Kafka, etc.). It provides a basic in-memory Product REST API built with Kotlin and Spring WebFlux.
The intention is to pull this repo in as a git submodule when you need a running HTTP target for testing API gateway routing (Kong), event streaming integration (Kafka), or any other infrastructure POC — without needing to spin up a dedicated service each time.
Exposes a reactive CRUD REST API over an in-memory product store:
| Method | Path | Description | Status |
|---|---|---|---|
| GET | /products |
List all products | 200 |
| GET | /products/{id} |
Get product by id | 200 |
| POST | /products |
Create a product | 201 |
| DELETE | /products/{id} |
Delete a product | 204 |
curl -X POST http://localhost:8080/products \
-H "Content-Type: application/json" \
-d '{"name":"Widget","price":9.99,"category":"gadgets"}'{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Widget",
"price": 9.99,
"category": "gadgets"
}- Spring Boot 4.1 (Spring WebFlux — reactive)
- Kotlin / JVM 21
- Gradle (Kotlin DSL)
- In-memory store — no database required
Prerequisites: JDK 21
./gradlew bootRunService starts on http://localhost:8080.
docker compose up --buildService starts on http://localhost:8080.
To stop:
docker compose down./gradlew test --tests "com.example.demo.unit.*"Covers ProductService (reactive StepVerifier) and ProductController (@WebFluxTest with mocked service).
./gradlew test --tests "com.example.demo.integration.CucumberIT"Scenarios in src/test/resources/features/products.feature spin up the full server (@SpringBootTest) and exercise the API end-to-end via WebTestClient.
./gradlew testAdd to another repo (e.g. kong-poc or kafka-poc):
git submodule add <this-repo-url> demo-spring
git submodule update --init --recursiveThen in the parent repo's docker-compose.yml, reference the submodule's service:
services:
demo-spring:
build: ./demo-spring
ports:
- "8080:8080"This keeps the demo service versioned alongside each POC without duplicating code.