Spring Data提供其他項(xiàng)目,用來幫你使用各種各樣的NoSQL技術(shù),包括MongoDB, Neo4J, Elasticsearch, Solr, Redis,Gemfire, Couchbase和Cassandra。Spring Boot為Redis, MongoDB, Elasticsearch, Solr和Gemfire提供自動配置。你可以充分利用其他項(xiàng)目,但你需要自己配置它們。
單個 RedisTemplate 的配置
使用 spring-boot-starter-data-redis 配置一個 redis 是很簡單的。
pom.xml 中該引入的依賴是要引入的,下面的是完整的 pom.xml
<?xml version="1.0" encoding="UTF-8"?>4.0.0 me.deweixu muti-redis 0.0.1-SNAPSHOT jar muti-redis config mutiple redis host org.springframework.boot spring-boot-starter-parent 2.0.4.RELEASE UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter-data-redis org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-maven-plugin