
redis
小石潭记丶
从小丘西行百二十步,隔篁竹,闻水声,如鸣珮环,心乐之。伐竹取道,下见小潭,水尤清冽。全石以为底,近岸,卷石底以出,为坻,为屿,为嵁,为岩。
展开
-
Springboot多实例启动定时任务
1.自备springboot项目2.启动实例一,配置8080(默认的端口)原创 2021-06-08 21:32:08 · 2053 阅读 · 7 评论 -
StringRedisTemplate操作hash
package com.frank.redis.web;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.data.redis.core.StringRedisTemplate;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.ann.原创 2021-06-08 20:48:26 · 5386 阅读 · 0 评论 -
一文了解SpringBoot Security的oauth2四种授权模式使用
项目结构:1.pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apach原创 2020-06-07 12:15:37 · 2195 阅读 · 0 评论 -
Springboot使用Redis实现分布式锁
基于 redis的 SETNX()、EXPIRE() 方法做分布式锁-SETNX()setnx接收两个参数key,value。如果key存在,则不做任何操作,返回0,若key不存在,则设置成功,返回1。-EXPIRE()expire 设置过期时间,要注意的是 setnx 命令不能设置 key 的超时时间,只能通过 expire() 来对 key 设置。注意:1.加锁过程必须设置过期时间,加锁和设置过期时间过程必须是原子操作如果没有设置过期时间,那么就发生死锁,锁永远不能被释放。如果加锁后原创 2020-06-07 10:47:41 · 698 阅读 · 0 评论 -
SSM框架SpringMVC+ Spring + MyBatis(集成redis缓存)
1.pom.xml <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency> <!-- config redis data and client jar--> <depe.原创 2020-05-17 19:14:48 · 439 阅读 · 0 评论 -
SpringBoot整合Redis、和Redis集群
一、SpringBoot整合Redis步骤:1.添加依赖:<!--redis --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId&g...原创 2018-08-30 16:37:22 · 8636 阅读 · 1 评论