GithubHelp home page GithubHelp logo

bygui86 / spring-redis Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 4.0 67 KB

Spring Boot Redis sample project

License: Apache License 2.0

Java 100.00%
spring-data spring-data-redis spring-redis redis-cache redis-db redis-database spring-boot-2 spring-boot-2-1 mavenw lombok-maven

spring-redis's Introduction

Spring Boot Redis sample project

Sub-projects

Spring Boot Redis sample projects:

  • Redis as DB - Spring Data Redis
  • Redis for caching - Spring Caching
  • Messaging with Redis - Spring Data Redis

Prerequisites

  • docker
  • curl / httpie / postman

Run sample

Start Redis

docker run -d --rm --name redis -p 6379:6379 redis:alpine redis-server --appendonly yes

Start application

cd <PROJECT_ROOT_FOLDER>/<SUB_PROJECT_FOLDER>
mvnw clean package spring-boot:run

Now you can call the exposed endpoints.

PLEASE NOTE: A bench of sample data are loading automatically in the DB.


Exposed endpoints

  • Redis as DB

    • GET /posts --> Get all posts
    • GET /posts/{id} --> Get post by id
    • POST /posts --> Insert new post
    • PUT /posts --> Update existing post
    • DELETE /posts --> Delete all posts
    • DELETE /posts/{id} --> Delete post by id
  • Redis for caching

    • GET /posts --> Get all posts
    • GET /posts/{id} --> Get post by id
    • POST /posts --> Insert new post
    • PUT /posts --> Update existing post
    • DELETE /posts --> Delete all posts
    • DELETE /posts/{id} --> Delete post by id
    • GET /cache --> Get all cache keys
    • GET /cache/{key} --> Get cache by key
    • DELETE /cache --> Evict whole cache
    • DELETE /cache/{key} --> Evict cache by key

PLEASE NOTE: URL root http://localhost:8080 PLEASE NOTE: Messaging with Redis does not expose any endpoint, it's a simple batch application


Links

Redis as DB

Redis for caching

Messaging with Redis

Redis

Others

spring-redis's People

Contributors

bygui86 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.