https://github.com/fartherp/shiro-redisson
shiro集成redisson
https://github.com/fartherp/shiro-redisson
redisson shiro
Last synced: 6 months ago
JSON representation
shiro集成redisson
- Host: GitHub
- URL: https://github.com/fartherp/shiro-redisson
- Owner: fartherp
- License: apache-2.0
- Created: 2018-12-29T09:55:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-24T12:46:37.000Z (about 2 years ago)
- Last Synced: 2025-04-03T12:22:34.340Z (7 months ago)
- Topics: redisson, shiro
- Language: Java
- Homepage:
- Size: 164 KB
- Stars: 6
- Watchers: 0
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# shiro-redisson
[](https://travis-ci.org/fartherp/shiro-redisson)
[](https://coveralls.io/github/fartherp/shiro-redisson?branch=master)
[](https://maven-badges.herokuapp.com/maven-central/com.github.fartherp/shiro-redisson/)
[](https://oss.sonatype.org/content/repositories/snapshots/com/github/fartherp/shiro-redisson/)
[](https://github.com/fartherp/shiro-redisson/releases)
[](https://www.apache.org/licenses/LICENSE-2.0.html)
[](https://www.openhub.net/p/shiro-redisson)
[](https://sonarcloud.io/dashboard?id=fartherp_javacode)功能简介
```
1.使用redisson包解决redis缓存
2.解决shiro-redis使用*查询时,导致redis长时间卡死
3.解决使用spring-boot-devtools,出现ClassCastException异常
4.支持redisson提供的编码类型,https://github.com/redisson/redisson/wiki/4.-data-serialization
```
## JDK
> 1.8/11/12/13## java使用
``` java@Bean
public MyShiroRealm myShiroRealm() {
return new MyShiroRealm();
}
@Bean
public SessionManager sessionManager(SessionDAO redisSessionDAO, ObjectProvider sessionListenersProvider) {
List sessionListeners = sessionListenersProvider.stream().collect(Collectors.toList());
DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
sessionManager.setSessionDAO(redisSessionDAO);
sessionManager.setSessionListeners(sessionListeners);
return mySessionManager;
}/**
* 内置session监听器,保证删除session/cache冗余的数据信息
*/
@Bean
public SessionListener sessionListener(SessionDAO redisSessionDAO, MyShiroRealm myShiroRealm) {
return new RedisSessionListener(redisSessionDAO, myShiroRealm);
}@Bean
public RedisCacheManager cacheManager(RedissonClient redissonClient) {
return new RedisCacheManager(redissonClient);
}@Bean
public RedisSessionDAO redisSessionDAO(RedisCacheManager cacheManager) {
return new RedisSessionDAO(cacheManager);
}```