-
Notifications
You must be signed in to change notification settings - Fork 784
Closed
Description
Hi Team,
First, thank you for the incredible work you've done on this amazing project.
Describe the bug
When using Spring @Cacheable annotation within a redis implementation, I can't see any span reported to zipkin.
Spring Cloud : 2.2.6.RELEASE
Spring-Boot : 2.3.5.RELEASE
Sample
Here a sample and simple code for Cacheable usage
The main controller...
@RequestMapping(value = "/user/v1/{idUser}",
produces = { "application/json" },
method = RequestMethod.GET)
public ResponseEntity<String> getUser(Integer idUser) {
Optional<String> userInformation = myService.getUserName(idUser);
return userInformation.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(userInformation.get());
}
The service...
@Cacheable(value = "myCacheNameInRedis")
public Optional<String> getUserName(Integer idUser) {
//call repository with idUser;
}
Dependencies used :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
Thank you