Skip to content

karazhanov/feigncache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

feign.cache

Library for caching feign request.

Using proxy pattern for wrap feign interface.

Standard feign interface

    public interface IUserRest {
        @RequestLine("GET /v1/user/{uid}")
        @RestCache(cacheTime = 5000)
        User getUser(@Param("uid") long uid);
        
        @RequestLine("GET /v1/user/full/{uid}")
        User getUserFull(@Param("uid") long uid);
    }

Annotation @RestCache on method enable caching for this method. Can set caching time. Default is 5000ms.

For using cache for feign you must wrap REST client.

Without cache

   IUserRest userCollector = 
                Feign.builder().target(IUserRest.class, url);

With cache

   IUserRest userCollector = 
       RestClientCache.wrap(
               Feign.builder().target(IUserRest.class, url);
       );    

About

Project for caching feign requests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors