Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以把连接redis客户端改为lettuce吗 #142

Open
hwz453843794 opened this issue Dec 29, 2020 · 2 comments
Open

可以把连接redis客户端改为lettuce吗 #142

hwz453843794 opened this issue Dec 29, 2020 · 2 comments

Comments

@hwz453843794
Copy link

可以把连接redis客户端改为lettuce吗

@yiyingcanfeng
Copy link

我自己克隆了一个分支,shiro-redis,增加加了lettuce的支持
使用方法:

@Bean
public IRedisManager redisManager() {
    LettuceRedisManager manager = new LettuceRedisManager("127.0.0.1", 6379);
    manager.setDatabase(Integer.parseInt(database));
    // or: LettuceRedisManager manager = LettuceRedisManager.builder().host("127.0.0.1").port(6379).build();
    return manager;
}

pom.xml:

<dependency>
  <groupId>com.github.yiyingcanfeng</groupId>
  <artifactId>shiro-redis</artifactId>
  <version>3.4</version>
</dependency>

maven中央仓库的账号已经申请了,还在审核,再过一段时间就能上传到中央仓库了
我自己另搞了个nexus私服,想先用上的话可以在settings.xml里的mirror下面加上这段配置

<mirror>
  <id>myhwnexus</id>
  <mirrorOf>central</mirrorOf>
  <name>my_nexus</name>
  <url>http://119.3.224.57:8081/repository/maven-public</url>
</mirror>
<mirror>
  <id>aliyunmaven</id>
  <mirrorOf>*</mirrorOf>
  <name>阿里云公共仓库</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

@yiyingcanfeng
Copy link

已上传至maven中央仓库
pom.xml:

<dependency>
    <groupId>com.github.yiyingcanfeng</groupId>
    <artifactId>shiro-redis</artifactId>
    <version>3.5</version>
</dependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants