E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
redisTemplate
Redis高级客户端Lettuce详解
前提Lettuce是一个Redis的Java驱动包,初识她的时候是使用
RedisTemplate
的时候遇到点问题Debug到底层的一些源码,发现spring-data-redis的驱动包在某个版本之后替换为
weixin_30567225
·
2020-06-27 21:34
redis应用详解
)常用方法:get:获取存储在给定key值中的value值set:设置给定key值中的value值del:删除给定key值中的value值ValueOperationsvalueOperations=
redisTemplate
.opsFor
weixin_30367873
·
2020-06-27 18:07
Springboot
RedisTemplate
报No qualifying bean of type... 不能按类型装配注入
最近在做一个项目,项目地址:https://github.com/wangyuanjun008/wyj-springboot-security.git在项目中与redis集成,使用的依赖是:org.springframework.bootspring-boot-starter-data-redis在Controller中使用如下:@AutowiredprivateRedisTemplateredi
wangyuanjun008
·
2020-06-27 13:53
SpringBoot
spring-data-redis exposeConnection的作用
分析org.springframework.data.redis.core.
RedisTemplate
#execute(org.springframework.data.redis.core.RedisCallback
huiwq1990
·
2020-06-27 13:35
Redis有序集合和定时任务解决订单15分钟关闭
直接上代码下单减去库存publicStringupdatePersonStock(PageDatapd)throwsException{Mapresmap=newHashMapzset=
redisTemplate
.opsForZSet
小黑客xhk
·
2020-06-27 09:28
项目方案
spring集成redisCluster
简介在spring框架的web项目中使用
redisTemplate
操作rediscluster。
路小超
·
2020-06-27 08:59
redis
java
redis
jedis
spring
RedisTemplate
执行lua脚本,集群模式下报错解决
redis集群配置:在使用spring的
RedisTemplate
执行lua脚本时,报错EvalShaisnotsupportedinclusterenvironment,不支持cluster。
昵称jc
·
2020-06-27 05:34
java
使用springboot自带redis配置
redisTemplate
的单例模式和哨兵模式
文章目录1配置文件2配置模板2.1使用Jackson2JsonRedisSerializer的模板2.2使用GenericJackson2JsonRedisSerializer的模板3配置模板的工厂方法3.1单例模式的工厂方法3.2哨兵模式的工厂方法1配置文件application.properties#哨兵监听的RedisServer的名称sentinel.master=mySelfMaster
上善若泪
·
2020-06-27 02:55
redis
redisTemplate
模糊删除实现
redis没有直接提供模糊删除的实现,我们可以根据现有的指令进行组合实现:/** *@authorhuoNan *@version1.0 *@packagecom.cyipp.skynet.dcms *@classNameAppTest *@description测试类 *@time2018/8/1616:24 */@RunWith(SpringRunner.class)@SpringBootTe
一朵风中摇曳的水仙花
·
2020-06-27 02:17
redis
解决:Unexpected token (START_OBJECT), expected START_ARRAY: need JSON Array to contain As.WRAPPER_ARRA
1.
redisTemplate
报错:Causedby:com.fasterxml.jackson.databind.JsonMappingException:Unexpectedtoken(START_OBJECT
微风--轻许--
·
2020-06-27 00:06
坑
傻踩傻乐
...
Unexpected
token
START_OBJECT
expected
START_ARRAY
RedisTemplate
常用使用说明-opsForHash(3)
redisTemplate
.opsForHash().put("hashValue","map1","map1-1");
redisTemplate
.opsForHash().put("hashValue
欧拉兔
·
2020-06-26 22:22
Redis
RedisTemplate
常用使用说明--发布订阅
java配置importorg.springframework.data.redis.connection.RedisConnectionFactory;importorg.springframework.data.redis.listener.PatternTopic;importorg.springframework.data.redis.listener.RedisMessageListen
欧拉兔
·
2020-06-26 22:50
Redis
RedisTemplate
常用使用说明--通道操作
@Autowired@Resource(name="
redisTemplate
")privateRedisTemplatert;publicvoidflushdb(){rt.execute(newRedisCallback
欧拉兔
·
2020-06-26 22:50
Redis
RedisTemplate
常用使用说明--事务操作
Redis事务相关的命令参考https://www.runoob.com/redis/redis-transactions.htmlRedis事务在SpringBoot中的应用说明:下面以测试用例的形式说明Redis事务在SpringBoot中正确与错误的用法。首先,看一看当前测试用例的主体代码:importcom.imooc.ad.Application;importorg.junit.Test
欧拉兔
·
2020-06-26 22:50
Redis
springboot中redis挂掉了保证项目正常运行
redis挂掉了,改成直接去db查询try{Stringkey=username;//缓存存在booleanhasKey=
redisTemplate
.hasKey(key);StringdbPassword
一只小小小柒
·
2020-06-26 20:09
(原创)Java使用
RedisTemplate
操作Redis的那些坑
AutoWiredprivateRedisTemplateredisTemplate;异常现象:key会出现乱码127.0.0.1:6379>keys*1)"\xac\xed\x00\x05t\x00\x04name"原因:spring-data-redis的
RedisTemplate
trusause
·
2020-06-26 20:33
redis
JAVA
SpringBoot引入Redis报org.springframework.data.redis.core.
RedisTemplate
类找不到错误
今日在学习Redis时,发现导入
RedisTemplate
和RedisCacheManager失败,反复思索,终于找到解决办法,至此记下以便日后查阅。
小影__
·
2020-06-26 19:45
SpringBoot
RedisTemplate
map集合使用说明-opsForHash(三)
Java代码
redisTemplate
.opsForHash().put("hashValue","map1","map1-1");
redisTemplate
.opsForHash().put("hashValue
椰汁菠萝
·
2020-06-26 16:20
java
spring
使用
RedisTemplate
操作Redis数据库
GitHub:https://github.com/JDawnF目录一.什么是Redis二.
RedisTemplate
及其相关方法三.
RedisTemplate
操作Redis数据库的具体例子四.
RedisTemplate
striveb
·
2020-06-26 15:57
spring
Redis
数据库
【Redis】在实际Java项目中使用Redis的几个关键步骤
一、Redis基础学习参考:Redis教程二、
RedisTemplate
的应用参考:Spring中使用
RedisTemplate
操作Redis三、项目中的关键操作假设我需要存储用户的真实信息,并且对认证次数有限制
某科学的一文
·
2020-06-26 12:17
Redis
JAVA
后端
RedisTemplate
常用方法总结
很多公司都将
redisTemplate
进行了封装,封装成业务所需要的RedisUtil工具类方便进行调用,本篇文章总结了
redisTemplate
常用的一些方法。
nupt_kwz
·
2020-06-26 10:59
Redis
redisTemplate
实现分页缓存,简单demo用法
//类注入对象@Autowired@Qualifier("
redisTemplate
")privateRedisTemplateredisTemplate;StringhashKey="_PNO"+pno
着实着迷
·
2020-06-26 08:23
redis相关
spring boot框架与Redis整合Unexpected character ('¬' (code 172)): expected a valid value
使用
redisTemplate
默认的序列化规则,改变默认的序列化规则(配置后所有的类保存到redis都会使用json格式,这也是2.0以后的新特性);@BeanpublicRedisCacheManagerMyRedisCacheManager
qq_44760024
·
2020-06-26 03:13
redis
spring
boot
redis设置 当天定时数据过期,定时失效
redis定时过期,清除我这里用的是
redisTemplate
控制的redis可以发现他的put方法除了key和value还会放一个参数进去,就是他的失效时间
redisTemplate
.opsForValue
张鱼の
·
2020-06-26 01:56
redis
redis 生成订单单号(spring
redisTemplate
)
单号规则YYyyyyMMdd+六位序列号,每天从000001开始privatesynchronizedStringgetApmtNo(){StringformatDate=DateUtil.format(newDate(),yyyyMMdd);Stringprefix=YY+formatDate;Stringrediskey=“redis前缀key方便分组”+prefix;//key存在返回加一后
qq_41670017
·
2020-06-25 21:54
redis
【SpringBoot】SpringBoot整合Redis 使用Redis
SpringBoot整合Redis文章目录SpringBoot整合Redis添加redis的起步依赖配置redis的连接信息注入
RedisTemplate
测试redis操作使用Redis数据库Redis
渐若窥宏大
·
2020-06-25 20:29
Spring
Boot
Redis
Java
SpringBoot
Redis
缓存
整合
Spring Cache基于Redis缓存
Redis1.1基于Redis的SpringCache1.1.1使用步骤:(1).导入pom依赖:org.springframework.bootspring-boot-starter-cache(2).创建
RedisTemplate
我叫钱多多_
·
2020-06-25 20:07
RedisTemplate
的各种操作(set、map、list、value)
注入以下
RedisTemplate
@AutowiredprivateRedisTemplateredisTemplate;1、保存和读取Set:代码示例: SetOperationsset=
redisTemplate
.opsForSet
踩到最基点
·
2020-06-25 18:07
springboot下redis高并发下的缓存穿透
ResponseBodyStringgetClassesById(@PathVariable("id")Integerid){RedisSerializerredisSerializer=newStringRedisSerializer();
redisTemplate
.setKeySerializer
冥冥之外
·
2020-06-25 16:35
springboot
springboot使用注解实现redis缓存
在springboot中两种方式使用缓存,一种是直接通过
RedisTemplate
来使用,另一种是使用SpringCache集成Redis(也就是注解的方式)。
快乐树上快乐果
·
2020-06-25 16:49
springboot
redis
解决Error creating bean with name '
redisTemplate
' defined in class path resource [org/异常问题
Springboot整合Redis出现了这类问题:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname‘
redisTemplate
Tronhon
·
2020-06-25 15:51
项目开发debug
redis与spring 集成(单机)
看网上大部分人都是配置
RedisTemplate
然后自己实现Cache接口里面的方法,但是spring-data-redis包里面有写好的RedisCache类,因此下面配置就是使用spring-data-redis
erika002
·
2020-06-25 12:52
运行期间动态切换Redis数据库
publicvoidselectDB(intdb){LettuceConnectionFactoryfactory=(LettuceConnectionFactory)
redisTemplate
.getConnectionFactory
Aaron_涛
·
2020-06-25 06:02
数据库
Redis
spring中 @ConditionalOnBean
@ConfigurationpublicclassRedisConfig{@Bean@ConditionalOnMissingBean(name="
redisTemplate
")publicRedisTemplateredisTemplate
非衣鲲化
·
2020-06-25 05:19
spring
boot
Redis中禁止使用耗时命令和时间复杂度为O(n)的命令
经过一番努力,终于找到了事情的源头,新来的开发在本地调试
RedisTemplate
,这不是重点,重点在于他执行的是keys的模糊匹配,导致Redis阻塞,从而影响压测,好在这
p7+
·
2020-06-25 04:10
redis
redistemplate
动态切换dbindex
redisTemplate
.getConnectionFactory().getConnection().select(uvIndex);依据api此代码可以切换dbindex,不过实际没有生效!
qq_27621745
·
2020-06-25 03:03
随笔记录
Redis 序列化问题
解决redis序列化问题Springboot启动类中/***设置
redisTemplate
的序列化设置*@paramredisConnectionFactory*@return*/@BeanpublicRedisTemplateredisTemplate
詹姆斯-小佩奇
·
2020-06-25 02:19
SpringBoot
redis
Springboot - Redis 同源切换db,切换数据库
文章目录Springboot-Redis同源切换db,切换数据库1、使用
RedisTemplate
切换同源的RedisDBSpringboot-Redis同源切换db,切换数据库1、使用
RedisTemplate
简简单单OnlineZuozuo
·
2020-06-24 23:45
#
Redis
框架相关
-
SpringBoot体系
RedisTemplate
用法详解(转载)
原文:https://blog.csdn.net/javaxiaibai0414/article/details/88666453Redis可以存储键与5种不同数据结构类型之间的映射,这5种数据结构类型分别为String(字符串)、List(列表)、Set(集合)、Hash(散列)和Zset(有序集合)。Redis介绍Spring-data-redis是spring大家族的一部分,提供了在srpi
Bluewaiting蓝色等待
·
2020-06-24 23:08
redis
redis
扩展
redisTemplate
实现分布式锁
依赖jar包compilegroup:'redis.clients',name:'jedis',version:'2.8.1'compilegroup:'org.springframework.data',name:'spring-data-redis',version:'1.6.5.RELEASE'/***Redis的分布式锁对象*Createdbyzhengjyon2017/3/6.*/pub
阿尔托利雅-潘德拉贡
·
2020-06-24 22:00
java
RedisTemplate
下Redis分布式锁引发的系列问题
自己的项目因为会一直抓取某些信息,但是本地会和线上经常一起跑,造成冲突。这其实就是我们常说的分布式集群的问题了,本地和线上的服务器构成了集群以及QPS为2的小并发(其实也不叫并发,不知道拿什么词形容?)。首先,分布式集群的问题大家都知道,会造成数据库的插入重复问题,会造成一系列的并发性问题。解决的方式呢也大概如下几点,百度以及谷歌上都能搜到的解决方式:1:数据库添加唯一索引2:设计接口幂等性3:依
Leonis丶L
·
2020-06-24 08:09
Java
锁
Redis
redisTemplate
操作hash如何设置过期时间
redisTemplate
操作hash如何设置过期时间?
liuji0517
·
2020-06-24 06:13
SpringDataRedis 中自定义多个
RedisTemplate
实现 Redis 多数据源切换使用
一、前言目前前端对后端的接口调用,流行携带token的无状态http请求,token是一种具有有效期的字符串,使用Redis来存取,可以说是无缝对接。而token有多种类型,如普通用户端的userToken、管理员端的adminToken,须分库进行存储(Redis默认16个库),这对权限认证区分时会用到,这就涉及到SpringDataRedis数据库切换的问题。二、正文之前使用SpringBoo
IT小村
·
2020-06-24 02:46
Java
SpringBoot 集成Redis Cluster和
RedisTemplate
先看示例://将验证码放入缓存,并设置自动过期时间CacheUtils.put(CacheKey.PHONE_VERIFY_CODE.key(phone),code,1,TimeUnit.HOURS);//从缓存中获取验证码Stringcode=CacheUtils.get(CacheKey.PHONE_VERIFY_CODE.key(phone));//删除缓存CacheUtils.del(Ca
酷鱼影子
·
2020-06-24 01:44
redis
【更新】SpringBoot自带
RedisTemplate
执行lua脚本以及预加载lua脚本到Redis集群
RedisTemplate
执行lua脚本引入lua脚本。
武话不港
·
2020-06-24 00:33
redis
redis学习(六)rdm乱码(mac版)
PostConstruct在构造函数之后执@PostConstructprivatevoidinit(){
redisTemplate
.setKeySerializer(RedisSerializer.string
jack_bob
·
2020-06-23 20:27
redis学习
基于spring的
redisTemplate
的缓存工具类
1、spring相关配置如下:2、缓存工具类CacheUtilspackagecom.lh.core.core.util;importjava.util.Map;importjava.util.Set;importjava.util.concurrent.TimeUnit;importorg.springframework.data.redis.core.BoundHashOperations;i
iteye_3489
·
2020-06-23 19:16
java
spring
redisTemplate
Spring Data Redis事务的正确使用姿势
1、execute(SessionCallbacksession)方法我们都知道Redis的事务的命令主要有multi、exec、discard和watch,在
RedisTemplate
中也是对应的有这几种方法
H阿布
·
2020-06-23 16:31
redis
spring
[springBoot] Springboot 整合redis并实现自定义序列化遇到的问题
org.springframework.beans.factory.NoSuchBeanDefinitionException:Noqualifyingbeanoftype'org.springframework.data.redis.core.
RedisTemplate
'available
中年油腻男人的转型之路
·
2020-06-23 16:19
SpringBoot
Redis
Spring boot 动态切换 Redis database
项目需要动态切换Redisdatabase,在网上找了好久都是使用多个
RedisTemplate
,这种配置比较麻烦,自己研究测试使用一种简单的方法可以实现,性能方面未测试,请大家谅解。
wudliy
·
2020-06-23 11:51
编程笔记
上一页
27
28
29
30
31
32
33
34
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他