Add property to enable Caffeine async cache mode - #51844
Open
harrisleesh wants to merge 1 commit into
Open
harrisleesh wants to merge 1 commit into
harrisleesh wants to merge 1 commit into
Conversation
CaffeineCacheManager supports asynchronous caches backed by Caffeine's AsyncCache via setAsyncCacheMode, which adds support for Cache.retrieve. The cache auto-configuration only exposed spring.cache.caffeine.spec, so enabling async cache mode required a custom CaffeineCacheManager bean or a CacheManagerCustomizer. Add a spring.cache.caffeine.async property (default false) wired to CaffeineCacheManager.setAsyncCacheMode in CaffeineCacheConfiguration. See spring-projectsgh-51843 Signed-off-by: seonghun lee <harrisleesh@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CaffeineCacheManagersupports asynchronous caches backed by Caffeine'sAsyncCacheviasetAsyncCacheMode(true)(since Framework 6.1), which adds support forCache.retrieve— the non-blocking retrieval path used by@CacheableforCompletableFuture/reactive return types.The cache auto-configuration only exposed
spring.cache.caffeine.spec, so enabling async cache mode previously required a customCaffeineCacheManagerbean or aCacheManagerCustomizer.This adds a
spring.cache.caffeine.asyncproperty (defaultfalse), wired toCaffeineCacheManager.setAsyncCacheMode(...)inCaffeineCacheConfiguration, plus tests (async enabled exposes theAsyncCache; default keeps the synchronous cache) and a short reference-docs note.Opened alongside gh-51843 — happy to hold or adjust pending your decision there.
See gh-51843