Spring boot 2 - memcached - PullRequest
       9

Spring boot 2 - memcached

0 голосов
/ 12 ноября 2018

Я пытаюсь создать кеш, используя memcached с lib https://github.com/sixhours-team/memcached-spring-boot

Я думаю, что все сделал, но это не работает. Мой код:

pom.xml

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-cache</artifactId>
    </dependency>
    <dependency>
        <groupId>io.sixhours</groupId>
        <artifactId>memcached-spring-boot-starter</artifactId>
        <version>1.3.0</version>
    </dependency>

apllication.yml

memcached.cache:
  servers: localhost:11211
  mode: static
  expirations: 3600

приложение. код

@SpringBootApplication
@EnableCaching
public class CRMProxyApplication extends SpringBootServletInitializer {

 @Cacheable("couponCache")
 @GetMapping(path = Mappings.GET_BEST_OF_AMAZON, produces = 
 MediaType.APPLICATION_JSON_VALUE)
 public ResponseEntity<Object> getCouponList(@RequestParam(value = "p_client_uid") Integer pClientUID) {
        return new ResponseEntity<> (couponManagementService.getCouponList(pClientUID), HttpStatus.OK);}

При запуске приложения показывать журнал

 INFO net.spy.memcached.MemcachedConnection:  Added {QA sa=/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue

Использование Spring Boot версии 2.0.6 MacOS

Что я делаю не так? :)

PS: Если у кого-то есть рабочий пример, поделитесь пожалуйста.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...