Skip to content

Spring Boot 3.2.2 Upgrade Redis - Null key returned for cache operation #2855

Closed as not planned
@zoroglu

Description

@zoroglu

After the spring 3.2.2 upgrade Redis Cache gives
Null key returned for cache operation

spring-boot version: 3.2.2

<dependency>
  <groupId>redis.clients</groupId>
  <artifactId>jedis</artifactId>
  <version>5.1.0</version>
</dependency>
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-data-redis</artifactId>
  <exclusions>
    <exclusion>
      <groupId>io.lettuce</groupId>
        <artifactId>lettuce-core</artifactId>
    </exclusion>
  </exclusions>
</dependency>

Cachable Method:

@Cacheable(value = "user", key = "#username", unless = "#result == null")
public String findUsername(String username) {
    ...
}

but if I use key = "#a0" instead of key = "#username", the problem is solved.

@Cacheable(value = "user", key = "#a0", unless = "#result == null")
public String findUsername(String username) {
    ...
}

There was no need to do it this way in the previous version. My previous versions:
spring-boot version: 2.7.4
redis.clients jedis version :3.9.0

What is the reason?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions