草庐IT

docker - 如何使用 Docker 配置带有 redis 的 spring boot web 应用程序

我有一个小型的springbootweb应用程序,它将数据保存到redis。运行docker-compose.yml容器后启动但在localhost:8085我有“连接已重置”。springboot应用.ymlserver:address:127.0.0.1---spring:profiles:developmentserver:address:127.0.0.1---spring:profiles:productionserver:address:127.0.0.1docker-compose.ymlweb:build:docker_appports:-"8085:8080"link

spring-boot - Spring Boot redisTemplate Autowiring 失败

我尝试将springboot+redis集成到我的应用程序中。pom.xml中的相关设置如下,org.springframework.bootspring-boot-starter-data-redis应用程序主要如下,@SpringBootApplication@EnableTransactionManagement@ImportResource({"classpath*:applicationContext.xml"})publicclassExamsCenterApplication{publicstaticvoidmain(String[]args){SpringApplica

spring-boot - Spring Boot redisTemplate Autowiring 失败

我尝试将springboot+redis集成到我的应用程序中。pom.xml中的相关设置如下,org.springframework.bootspring-boot-starter-data-redis应用程序主要如下,@SpringBootApplication@EnableTransactionManagement@ImportResource({"classpath*:applicationContext.xml"})publicclassExamsCenterApplication{publicstaticvoidmain(String[]args){SpringApplica

redis - spring-boot RedisTemplate<String,User> 异常

我的代码是这样的:Java:@AutowiredprivateRedisTemplatemyTemplate;@OverridepublicStringlogin(Stringemail,Stringpassword){Useruser=this.userRepository.findByEmailAndPassword(email,password);System.out.println(user);if(user==null)returnnull;Stringkey1="lic"+"$"+user.getId()+"$"+user.getRole()+"$"+user.getNam

redis - spring-boot RedisTemplate<String,User> 异常

我的代码是这样的:Java:@AutowiredprivateRedisTemplatemyTemplate;@OverridepublicStringlogin(Stringemail,Stringpassword){Useruser=this.userRepository.findByEmailAndPassword(email,password);System.out.println(user);if(user==null)returnnull;Stringkey1="lic"+"$"+user.getId()+"$"+user.getRole()+"$"+user.getNam

spring-boot - @Cacheable 在 Controller 中工作,但不在服务内部

我在SpringBoot中遇到了这个奇怪的问题,其中@Cacheable在Controller中工作但不在服务内部。我可以在Redis中看到GET调用,但看不到PUT调用。这是有效的,因为它在Controller内部@RestController@RequestMapping(value="/places")publicclassPlacesController{privateAwesomeServiceawesomeService;@AutowiredpublicPlacesController(AwesomeServiceawesomeService){this.awesomeSe

spring-boot - @Cacheable 在 Controller 中工作,但不在服务内部

我在SpringBoot中遇到了这个奇怪的问题,其中@Cacheable在Controller中工作但不在服务内部。我可以在Redis中看到GET调用,但看不到PUT调用。这是有效的,因为它在Controller内部@RestController@RequestMapping(value="/places")publicclassPlacesController{privateAwesomeServiceawesomeService;@AutowiredpublicPlacesController(AwesomeServiceawesomeService){this.awesomeSe

java - 为 spring-boot redis 缓存配置配置一个新的序列化器

我一直在尝试更改spring-bootredis缓存的默认序列化程序,因为我想从默认更改为Jackson2Json实现之一。Jackson2Json库有两个实现,其中一个是:GenericJackson2JsonRedisSerializer,我可以在以下bean实例化中使用它:@Bean@PrimarypublicRedisCacheConfigurationdefaultCacheConfig(ObjectMapperobjectMapper){returnRedisCacheConfiguration.defaultCacheConfig().serializeKeysWith(

java - 为 spring-boot redis 缓存配置配置一个新的序列化器

我一直在尝试更改spring-bootredis缓存的默认序列化程序,因为我想从默认更改为Jackson2Json实现之一。Jackson2Json库有两个实现,其中一个是:GenericJackson2JsonRedisSerializer,我可以在以下bean实例化中使用它:@Bean@PrimarypublicRedisCacheConfigurationdefaultCacheConfig(ObjectMapperobjectMapper){returnRedisCacheConfiguration.defaultCacheConfig().serializeKeysWith(

spring-boot - AppEngine 标准和 Memorystore 连接问题

我有Memorystore实例:gcloudredisinstanceslist--regioneurope-west1INSTANCE_NAMEVERSIONREGIONTIERSIZE_GBHOSTPORTNETWORKRESERVED_IPSTATUSCREATE_TIMEsm-cacheREDIS_4_0europe-west1BASIC110.1.1.36379default10.1.1.0/28READY2019-05-30T19:03:29和在同一区域运行的AppEngine标准应用程序。连接需要VPC。我尝试添加它而不缺少它。这种连接的CIDR应该是什么?与Memory