草庐IT

boot_completed

全部标签

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

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

java - spring boot + redis cache + @Cacheable 适用于某些方法而不适用于其他方法

我将springboot与redis一起用于缓存,以通过减少对RDBMS系统的查询来提高应用程序性能。它有效,因为它准确地缓存了另一个Controller的方法,但它不缓存下面的Controller:@RequestMapping(method=RequestMethod.GET)@Cacheable("findByTaxOfficeId")privateTaxPayerNameResponsefindByTaxOfficeId(@RequestParam(required=true,value="uid")StringtaxOfficeId){StampDutyOfficestamp

java - spring boot + redis cache + @Cacheable 适用于某些方法而不适用于其他方法

我将springboot与redis一起用于缓存,以通过减少对RDBMS系统的查询来提高应用程序性能。它有效,因为它准确地缓存了另一个Controller的方法,但它不缓存下面的Controller:@RequestMapping(method=RequestMethod.GET)@Cacheable("findByTaxOfficeId")privateTaxPayerNameResponsefindByTaxOfficeId(@RequestParam(required=true,value="uid")StringtaxOfficeId){StampDutyOfficestamp