This project demo redis cache how to work in Spring Boot.
- Startup the Database, Redis
docker-compose up -d ./docker/docker-compose.yml
- Start main program
- Send one product:
curl --location --request POST 'http://localhost:8080/products' --header 'Content-Type: application/json' --data-raw '{
"number": 100,
"name": "product1"
}'
- Search by id:
curl --location --request GET 'http://localhost:8080/products/1'
- See data at redis.
- Or just run test at RedisCacheServiceTest, it's will test cache.