Comments (1)
Simple customizer:
CacheManagerCustomizer<CaffeineCacheManager> { cacheManager ->
for (spec in Binder.get(env).bindOrCreate("caffeine.specs", HashMap::class.java)) {
cacheManager.registerCustomCache(spec.key.toString(),
Caffeine.from(spec.value.toString()).build())
}
}
Config with proper default (which is not posible with coffee-boots):
spring.cache.type=caffeine
# default (optional)
spring.cache.caffeine.spec=maximumSize=250,expireAfterWrite=15m
# custom configs 0..N
caffeine.specs.places=maximumSize=1000,expireAfterWrite=1h
No deps, no (additional) autoconfiguration magic.
@stepio what do you think - may it be proposed as little PR to Spring Boot?
from coffee-boots.
Related Issues (11)
- CaffeineSpecSpringAutoConfiguration cacheManager @ConditionalOnMissingBean by type HOT 1
- java.lang.IllegalStateException: No CacheResolver specified, and no bean of type CacheManager found. Register a CacheManager bean or remove the @EnableCaching annotation from your configuration. HOT 2
- How to use refreshAfterWrite HOT 1
- DepShield Deprecation Notice
- [DepShield] (CVSS 8.1) Vulnerability due to usage of org.assertj:assertj-core:3.4.1 HOT 1
- Metrics HOT 7
- Consider having a default spec that can be overruled per cache name HOT 4
- Add CacheCondition to CaffeineSpecAutoConfiguration to avoid creating bean if not needed HOT 4
- DepShield encountered errors while building your project HOT 1
- more details in readme.md HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coffee-boots.