-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Closed as not planned
Closed as not planned
Copy link
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement
Description
Both Jedis and Lettese clients support specifying a database in the URL
- Jedis: https://github.com/redis/jedis/blob/master/src/main/java/redis/clients/jedis/util/JedisURIHelper.java
- Lettuce: https://github.com/redis/lettuce/wiki/Redis-URI-and-connection-details
Unfortunately, spring-boot-autoconfigure ignore them
@Override
public Standalone getStandalone() {
if (this.properties.getUrl() != null) {
ConnectionInfo connectionInfo = connectionInfo(this.properties.getUrl());
return Standalone.of(connectionInfo.getUri().getHost(), connectionInfo.getUri().getPort(),
this.properties.getDatabase());
}
return Standalone.of(this.properties.getHost(), this.properties.getPort(), this.properties.getDatabase());
}
This causes the following URL actually connect to database 0
spring:
data:
redis:
url: redis://127.0.0.1:6379/8
The current workaround in my project is
spring:
data:
redis:
url: redis://127.0.0.1:6379/8
database: 8
: (
Metadata
Metadata
Assignees
Labels
status: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: enhancementA general enhancementA general enhancement