Bump ch.qos.logback:logback-core from 1.5.18 to 1.5.19 in /samples (#990)
Bumps ch.qos.logback:logback-core from 1.5.18 to 1.5.19.
updated-dependencies:
- dependency-name: ch.qos.logback:logback-core dependency-version: 1.5.19 dependency-type: direct:production …
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Introduction
JetCache is a Java cache abstraction which provides uniform usage for different caching solutions. It provides more powerful annotations than those in Spring Cache. The annotations in JetCache supports native TTL, two level caching, and automatically refresh in distrubuted environments, also you can manipulate
Cacheinstance by your code. Currently, there are four implementations:RedisCache,TairCache(not open source on github),CaffeineCache(in memory) and a simpleLinkedHashMapCache(in memory). Full features of JetCache:Cacheinstance with cache managerCacheinstance and method level cachefastjson/fastjson2/jackson; Value convertor supported:java/kryo/kryo5requirements:
Visit docs for more details.
Getting started
Method cache
Declare method cache using
@Cachedannotation.expire = 3600indicates that the elements will expire in 3600 seconds after being set. JetCache automatically generates the cache key with all the parameters.Using
keyattribute to specify cache key using SpEL script.In order to use parameter name such as
key="#userId", you javac compiler target must be 1.8 and above, and the-parametersshould be set. Otherwise, use index to access parameters likekey="args[0]"Auto refreshment:
CachePenetrationProtect annotation indicates that the cache will be loaded synchronously in multi-thread environment.
Cache API
Create a
Cacheinstance withCacheManager:The code above create a
Cacheinstance.cacheType = CacheType.BOTHdefine a two level cache (a local in-memory-cache and a remote cache system) with local elements limited upper to 50(LRU based evict). You can use it like a map:Advanced API
Asynchronous API:
Distributed lock:
Read through and auto refresh:
Configuration with Spring Boot
pom:
App class:
spring boot application.yml config:
More docs
Visit docs for more details.
For upgrade see changelog and compatibility notes.