mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05:49 +00:00
updates
This commit is contained in:
parent
4a61bb7681
commit
3d1a428a38
4 changed files with 62 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
|
4
pom.xml
4
pom.xml
|
@ -42,6 +42,10 @@
|
||||||
<groupId>org.springframework.kafka</groupId>
|
<groupId>org.springframework.kafka</groupId>
|
||||||
<artifactId>spring-kafka</artifactId>
|
<artifactId>spring-kafka</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-testcontainers</artifactId>
|
<artifactId>spring-boot-testcontainers</artifactId>
|
||||||
|
|
1
response.json
Normal file
1
response.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,56 @@
|
||||||
package org.springframework.samples.petclinic.config;public class RedisConfig {
|
// package org.springframework.samples.petclinic.config;
|
||||||
}
|
//
|
||||||
|
//
|
||||||
|
// import org.springframework.beans.factory.annotation.Value;
|
||||||
|
// import org.springframework.context.annotation.Bean;
|
||||||
|
// import org.springframework.context.annotation.Configuration;
|
||||||
|
// import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||||
|
// import org.springframework.data.redis.cache.RedisCacheManager;
|
||||||
|
// import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||||
|
// import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||||
|
// import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||||
|
// import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||||
|
//
|
||||||
|
// import java.time.Duration;
|
||||||
|
//
|
||||||
|
// @Configuration
|
||||||
|
// public class RedisConfig {
|
||||||
|
// @Value("${redis.host}")
|
||||||
|
// private String redisHost;
|
||||||
|
//
|
||||||
|
// @Value("${redis.port}")
|
||||||
|
// private int redisPort;
|
||||||
|
//
|
||||||
|
// @Bean
|
||||||
|
// public LettuceConnectionFactory redisConnectionFactory() {
|
||||||
|
// RedisStandaloneConfiguration configuration = new
|
||||||
|
// RedisStandaloneConfiguration(redisHost, redisPort);
|
||||||
|
//
|
||||||
|
// return new LettuceConnectionFactory(configuration);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//// @Bean
|
||||||
|
//// public RedisCacheManager cacheManager(RedisConnectionFactory connectionFactory) {
|
||||||
|
//// return RedisCacheManager.create(connectionFactory);
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
// @Bean
|
||||||
|
// public RedisCacheManager cacheManager() {
|
||||||
|
// RedisCacheConfiguration cacheConfig =
|
||||||
|
// myDefaultCacheConfig(Duration.ofMinutes(10)).disableCachingNullValues();
|
||||||
|
//
|
||||||
|
// return RedisCacheManager.builder(redisConnectionFactory())
|
||||||
|
// .cacheDefaults(cacheConfig)
|
||||||
|
// .withCacheConfiguration("vaccines", myDefaultCacheConfig(Duration.ofMinutes(5)))
|
||||||
|
// .withCacheConfiguration("vaccine", myDefaultCacheConfig(Duration.ofMinutes(1)))
|
||||||
|
// .build();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private RedisCacheConfiguration myDefaultCacheConfig(Duration duration) {
|
||||||
|
// return RedisCacheConfiguration
|
||||||
|
// .defaultCacheConfig()
|
||||||
|
// .entryTtl(duration)
|
||||||
|
// .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new
|
||||||
|
// GenericJackson2JsonRedisSerializer()));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
Loading…
Reference in a new issue