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
SpringBoot Redis使用fastjson进行序列化
org.springframework.data.redis.serializer.JdkSerializationRedisSerializer这个类来做序列化我们使用jackson方式:Jacksonredis序列化是spring中自带的@Bean(name="
redisTemplate
weixin_33768481
·
2020-08-15 03:21
java
数据库
json
dubbo的序列化问题
例子:调用系统在调用缓存服务的时候,通过工厂方法传递一个redisService,这无意间就形成了参数传递,不仅redisService需要实现序列化,而redisService内封装的
redisTemplate
kiruma
·
2020-08-15 03:12
java
SpringBoot之Redis序列化策略
SpringBoot默认提供有两种序列化的策略,分别是StringRedisTemplate和
RedisTemplate
,其中StringRedisTemplate用于操作字符串,
RedisTemplate
chougong1994
·
2020-08-15 02:55
redis-springboot-
redistemplate
更改序列化方式
redisTemplate
默认的序列化方式为jdkSerializeable,StringRedisTemplate的默认序列化方式为StringRedisSerializer可以通过手动配置,将
redisTemplate
最是那一低头的温柔
·
2020-08-15 01:58
springboot
Redis
RedisTemplate
注入失败
报错信息如下:十一月12,20185:19:56下午org.apache.catalina.core.StandardContextlistenerStart严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenero
燕雷
·
2020-08-15 00:46
Redis--流水线
Demo:
redisTemplate
.executePipelined(newSessionCallback(){@Overridepubli
BtWangZhi
·
2020-08-14 23:14
Redis/Memcache
SpringBoot基本操作(七)——SpringBoot整合Shiro权限管理(完整demo+界面)
——使用IDEA打war包发布及测试(三)SpringBoot基本操作——SpringBoot整合SpringDataJpa(有demo)(四)SpringBoot基本操作——SpringBoot使用
RedisTemplate
朱利尔
·
2020-08-14 22:55
SpringBoot
redis事务方法释疑以及
RedisTemplate
事务实战
redis事务释疑以及
RedisTemplate
实战1.背景2.事务释疑redis支持原子性吗?
weixin_43493520
·
2020-08-14 21:42
redis
spring
java
Spring Boot使用Redis-
RedisTemplate
这个类是怎么来的?
类似SpringBoot整合Redis时,只需简单的在配置文件中写上Redis的服务器的地址密码等,然后直接使用
RedisTemplate
即可操作redis了。
绅士jiejie
·
2020-08-14 21:40
Spring
Boot
Redis 分布式锁
paramvalue当前时间+超时时间*@return*/publicbooleanlock(Stringkey,Stringvalue,StringReidsTemplateredisTemplate){if(
redisTemplate
.opsForValue
天人不合一
·
2020-08-14 20:33
技术
Redis之
RedisTemplate
常用接口详解
一、
RedisTemplate
常用接口
RedisTemplate
中提供了以下常用的几个接口:privateValueOperationsvalueOps;privateListOperationslistOps
Java高知社区
·
2020-08-14 19:09
Redis
RedisTemplate
nosql
解决定时器Quartz中任务调度无法使用Spring自动注入的问题
描述:需求:使用定时器来实现定时持久化Redis中的数据到Mysql——定时器选择Quartz问题:使用定时器定义Job时需要使用
RedisTemplate
对象来操作Redis,一般情况下的使用方式为:
黯叶
·
2020-08-14 19:49
SSM
编程技术
RedisTemplate
常用集合使用说明-opsForZSet(六)
Java代码
redisTemplate
.opsForZSet().add("zSetValue","A",1);
redisTemplate
.opsForZSet().add("zSetValue","B
凌辰1228
·
2020-08-14 19:52
Redis
lombok使用的坑:equals和hashCode方法
我的个人网站:http://riun.xyz/---packagehx.insist.
redistemplate
.other;importlombok.Data;@DatapublicclassPage
riun、
·
2020-08-14 17:43
java
Spring Boot 整合 Spring Cache + Redis(实现数据缓存)
这种方式相对于自己手动通过
RedisTemplate
往Redis中缓存数据(参考SpringBoot整合Redis)来说比
程序员35
·
2020-08-14 17:12
Spring
Boot
教程合集
Redis 系列-- SpringBoot 中
redisTemplate
的操作
SpringBoot中集成
redisTemplate
对Redis的操作(一)在Java操作redis时,有很多工具,redis官网中,就有很多操作,目前主流开发框架SpringBoot中,当然也有集成好的操作
chinaichao2949
·
2020-08-14 16:13
数据库
java
json
谈谈Quartz中遇到的深坑
最近在项目开发的时候,根据业务需求,需要配置为自定义Quartz任务(即:用户可以自定义任务执行时间)但是在即将写完的时候遇到一个非常头疼的问题:一个
redisTemplate
与workOrderService
L550834
·
2020-08-14 16:02
RedisTemplate
提供的API列表
字符串相关APIAPI描述set(Kkey,Vvalue)新增一个键值对,key为键,value为值get(Objectkey)获取指定key对应的值append(Kkey,Vvalue)在原有值的基础上新增字符串到末尾get(Kkey,longstart,longend)获取key键所对应value从start位置开始到end位置之间的字符串getAndSet(Kkey,Vvalue)获取原来k
名字想好没。
·
2020-08-14 15:15
Java
如何解决
redisTemplate
注入为空问题
*集成redis时,redis工具类中的
redisTemplate
注入后总是为空。
·
2020-08-14 12:31
java.lang.ClassNotFoundException: org.apache.commons.pool2.impl.GenericObjectPoolConfig
问题描述:Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'
redisTemplate
'definedinclasspathresource
weixin_30421809
·
2020-08-14 11:49
Redis —— Hash数据结构基本操作
此处我们使用
redisTemplate
,配置如下(详情请见链接:
RedisTemplate
访问Redis数据结构)HashOperations提供一系列方法操作hash。
枣面包
·
2020-08-14 02:11
后台开发
Redis
SpringBoot整合Redis,连接超时及其解决方案
SpringBoot中整合redis的步骤:1.引入redis的startersorg.springframework.bootspring-boot-starter-data-redis2.写配置类,注入名为
redisTemplate
以神之谕
·
2020-08-14 02:49
redis
spring-data-redis操作redis
1.在mavenpom文件中引入依赖2.在yml文件中配置redis的链接信息3.开始编码3.1引用
RedisTemplate
模板或者StringRedisTemplate@AutowiredprivateStringRedisTemplatestringRedisTemplate
永夜族
·
2020-08-14 02:11
redis
SpringBoot2整合Redis(使用jedis)
前言在本篇文章中将SpringBoot整合Redis,使用的是
RedisTemplate
,分别实现了SpringBoot与redis的单机版的整合。
qq_20012311
·
2020-08-14 02:57
springboot
spring
java
框架
spring-boot-starter-data-redis 2x用法
最近在研究redis,集成到springboot踩了很多坑,现将查询资料和见解记录下来一、2x与1x的区别创建缓存管理器方式如下方式,但是在2x中去掉了newRedisCacheManager(
redisTemplate
奋斗的String
·
2020-08-13 20:28
使用spring-boot-starter-data-redis操作redis
pom文件org.springframework.bootspring-boot-starter-data-redis代码@Autowired//使用字符串的方式进行存储,因为使用
redistemplate
心动不动就痛
·
2020-08-13 20:51
javaee
springboot中
RedisTemplate
的使用
springboot中
RedisTemplate
的使用参考了解Redis并在SpringBoot项目中使用Redis——以IBM为学习模板springboot之使用
redistemplate
优雅地操作redis
卡斯特梅的雨伞
·
2020-08-13 17:00
redis原子性读写操作之LUA脚本和watch机制
最近在开发电商平台的子系统——储值卡系统,系统核心业务涉及到金额消费以及库存控制,因此为了解决建立在内存上高并发情况下的事务控制,使用了spring封装的
RedisTemplate
执行lua脚本进行原子性操作
LzwGlory
·
2020-08-13 12:30
redis
SpringBoot集成Redis缓存
说在前面:本配置教程不是教你如何在SpringBoot中配置
RedisTemplate
来访问Redis,而是为了降低查询数据库的负载,而把Redis当做缓存来用,明白?
hello5orld
·
2020-08-13 11:47
Spring
Spring
Boot
SpringBoot
Redis
缓存
集成
Redis整合SpringBoot的工具类,配置类代码
RedisUtilsimportorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.data.redis.core.
RedisTemplate
快思慢思
·
2020-08-13 02:00
redistemplate
实现 setnx分布式锁
使用
RedisTemplate
的execute的回调方法,里面使用Setnx方法Setnx就是,如果没有这个key,那么就set一个key-value,但是如果这个key已经存在,那么将不会再次设置,get
Fan YC
·
2020-08-12 18:07
Redis怎么执行带参数的Lua脚本
开发中一般使用spring封装好的
RedisTemplate
去执行redis命令,那么看看
RedisTemplate
的execute()方法,发现有好几个重载的execute()方法,有一个重载的execute
绅士jiejie
·
2020-08-12 18:00
Spring
Boot
spring boot 2.0.3使用Lettuce Redis并配置 pool
依赖的jar包:org.springframework.bootspring-boot-starter-data-redisorg.apache.commonscommons-pool22.6.0
RedisTemplate
严的博客
·
2020-08-12 18:28
spring-boot
redis
Redis中
RedisTemplate
和Redisson管道的使用
当对Redis进行高频次的命令发送时,由于网络IO的原因,会耗去大量的时间。所以Redis提供了管道技术,就是将命令一次性批量的发送给Redis,从而减少IO。一、Jedis对redis的管道进行操作1、获取管道对象StringredisIp="192.168.110.110";intreidsPort=6379;Jedisjedis=newJedis(redisIp,reidsPort);Pip
weixin_33859665
·
2020-08-12 18:00
spring boot
RedisTemplate
实现 setnx exptime (扩展
redisTemplate
.setIfAbsent)
之前用
redisTemplate
实现setnxexptime时是分两步的
redisTemplate
.setIfAbsentredisTemplate.expire这样的不是原子性的可能在第一步与第二步之间重新发布了或者服务器重启了这个
铁铲
·
2020-08-12 18:23
cannot be cast to redis.clients.jedis.JedisCommands
异常代码try{Stringresult=
redisTemplate
.execute((RedisCallback)redisConnection->{JedisCommandscommands=(JedisCommands
thewaiting
·
2020-08-12 17:53
小问题
GenericJackson2JsonRedisSerializer 反序列化问题
在使用Spring-data-redis时,很多文章都推荐使用GenericJackson2JsonRedisSerializer作为
redisTemplate
的序列化执行器,然而,在遇到类中有LocalDateTime
woody_me2222
·
2020-08-12 17:35
BUGx
SpringMVC
springboot整合curator实现分布式锁模拟抢购场景
文章目录1.环境说明2.maven依赖3.代码实现3.1.Redis3.1.1.配置文件3.1.2.
redisTemplate
配置3.2.Curator3.1.1.配置文件3.1.2.Curator配置
枫灵小宇
·
2020-08-12 17:23
Redis
Java
分布式锁
【2020.07.11】Springboot redis 分布式锁,分别使用 setnx 和 redisson 实现
AutowiredprivateRedisTemplateredisTemplate;@GetMapping("/lock")publicResultlock(){Integerstock=(Integer)
redisTemplate
.opsForValue
耳森Paulson
·
2020-08-12 17:50
Spring
java
springboot
redisTemplate
redis实现分布式锁
获取锁实现原理使用redislua脚本lua脚本执行是个原子操作重要命令setnx如果key不存在则设置值代码:/***获取锁*原因是redis是单线程的一但一个线程获取锁后其它线程就不能获取的锁*@paramlockKey锁名称*@paramvalue值*@paramexpire过期时间*@paramtimeout等待超时时间*@return*/publicbooleangetLock(Stri
qq_34724270
·
2020-08-12 17:24
spring-data-redis之
redisTemplate
实现redis分布式锁,模拟高并发抢购场景
相关框架:spring、spring-data-redis、lettuceStep1、编写分布式锁工具,完成加锁与释放锁功能/***基于redis的分布式锁实现工具类*高并发访问同一资源时,使所有访问线程同步进行操作,使得该方法具有原子性*该资源可以存储在任何地方*例如:修改某库存数量,方法中先判断库存是否大于1,然后减去1*这两个操作中间可能延迟,让其他线程先把库存减成了0,最后库存变成了负数*
Elliotzzz
·
2020-08-12 17:28
使用lettuce和
redisTemplate
操作redis cluster踩坑日记
环境:虚拟机3主3从1、关闭slave是对读写都没有影响的2、关键就是关闭master,读写都会失败虽说可以设置lettuce的拓扑自动更新,但是redis的slave变成master是需要时间的在这段时间内的读写都无法进行,异常-->【connectionrefused】等到slave变成了master,读写才会恢复,但是依然会报警告,无法连接到xxx,哎...找了半天发现有个方法可以避免读的失
Elliotzzz
·
2020-08-12 17:56
spingCloud基于
redisTemplate
的redis的分布式锁
redisson来实现redis分布式锁(参考https://blog.csdn.net/lfwer/article/details/83901402),搭建起来比较麻烦,而且会有重复配置,偶尔看到一篇基于
redisTemplate
lfwer
·
2020-08-12 17:42
redis
springboot
springCloud
基于
redisTemplate
的redis的分布式锁正确打开方式
前言网上很多都是jedis客户端的形式实现分布式锁,没有
redisTemplate
形式的实现,而且众说纷杂有很多不合理的地方。实现思路是从我的参考博客仿照写的,讲的很清楚了,大家可以去我得参考博客看。
郭敬仰
·
2020-08-12 17:22
杂谈
RedisTemplate
的使用说明(常用接口方法)
在
RedisTemplate
中提供了几个常用的接口方法的使用,分别是:privateValueOperationsvalueOps;privateListOperationslistOps;privateSetOperationssetOps
hxpjava1
·
2020-08-12 17:02
redis
RedisTemplate
lettuce 实现分布式锁
springboot2.x以上使用redis时,默认使用了lettuce封装,比起jedis线程安全importlombok.extern.slf4j.Slf4j;importorg.springframework.data.redis.connection.RedisStringCommands;importorg.springframework.data.redis.connection.Re
xiehdsoo
·
2020-08-12 16:03
工具类
springboot
Redis分布式锁、
RedisTemplate
、lettuce实现
springboot新版本使用lettuce取代了jedis连接redis,分布式锁实现代码如下importlombok.extern.slf4j.Slf4j;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.data.redis.connection.RedisString
懒惰的小蜗牛
·
2020-08-12 16:04
Java
Redis
Redis分布式锁,基于StringRedisTemplate和基于Lettuce实现setNx
使用redis分布式锁,来确保多个服务对共享数据操作的唯一性一般来说有StringRedisTemplate和
RedisTemplate
两种redis操作模板。
aiqi458587
·
2020-08-12 16:32
LettuceConnectionFactory多配置,及配置原理详解
配置文件application.properties:#########-------------------------------------->Redis配置,因为是不同的数据库,所以需要配置不同的
redisTemplate
无Bug说
·
2020-08-12 14:34
SpringBoot
MyBatis-Redis-Cache 实现缓存
packagecom.vince.MyBatisCache;importorg.apache.ibatis.cache.Cache;importorg.springframework.data.redis.core.
RedisTemplate
久メ帝
·
2020-08-12 14:03
上一页
19
20
21
22
23
24
25
26
下一页
按字母分类:
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
其他