This code supports a blog post I wrote, and implements a reactive counter using Spring Boot, Kotlin, Kotlin Coroutines, and Redis.
git clone https://github.com/tginsberg/springboot-reactive-kotlin-coroutines.git
Technologies used in this project:
- Java 11 (but 8 will work fine)
- Spring Boot 2.3 (but 2.2.x will work fine)
- Kotlin 1.3.72
- Gradle 6.3
To run this project, you'll need:
- Redis installed and ready to use on the default port
- A cursory understanding of reactive concepts and Spring Boot
./gradlew bootRun
Purpose | Method | URL | Accept Header |
---|---|---|---|
Current state of counter | GET | / |
application/json |
Counter event stream | GET | / |
text/event-stream |
Increment counter | PUT | /up |
application/json |
Decrement counter | PUT | /down |
application/json |