A Spring Boot service that simulates sports betting event outcome handling and bet settlement via Kafka and RocketMQ. Submitting an event outcome publishes it to Kafka; a consumer matches pending bets by event ID and forwards them to RocketMQ for settlement.
Java 25, Spring Boot 3.4, Spring Kafka, Apache RocketMQ, H2 (in-memory), Docker Compose
- Docker and Docker Compose
docker compose up --buildWait for the service to become healthy (port 8889).
Runs the full pipeline without RocketMQ containers — settlement messages are logged instead:
SPRING_PROFILES_ACTIVE=mock-rocketmq docker compose up --buildSubmit an event outcome:
curl -X POST http://localhost:8889/api/event-outcomes \
-H "Content-Type: application/json" \
-d '{"eventId":"EVT-001","eventName":"Champions League Final","eventWinnerId":"TEAM-A"}'The database is pre-loaded with sample bets for EVT-001 and EVT-002.
./mvnw test