Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caffeine configuration - Allow global default configuration #27023

Closed
renzodf opened this issue Jul 29, 2022 · 9 comments · Fixed by #30340
Closed

Caffeine configuration - Allow global default configuration #27023

renzodf opened this issue Jul 29, 2022 · 9 comments · Fixed by #30340
Assignees
Labels
area/cache kind/enhancement New feature or request
Milestone

Comments

@renzodf
Copy link

renzodf commented Jul 29, 2022

Description

Hello,

Currently, "By default, caches do not perform any type of eviction if not configured." and the configuration is done trough a set of configuration variables (quarkus.cache.caffeine."cache-name".*). This requires a configuration per cache, which can be extensive if the number of cache is high.

It would be nice to introduce default configuration keys to allow the configuration of all caches in few lines:

quarkus.cache.caffeine.initial-capacity
quarkus.cache.caffeine.maximum-size
quarkus.cache.caffeine.expire-after-write
quarkus.cache.caffeine.expire-after-access
quarkus.cache.caffeine.metrics-enabled

Note: initial-capacity and maximum-size would configure each cache individually -> will not act as global limits.

Cheers,
Renzo

Implementation ideas

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Jul 29, 2022

/cc @gwenneg

@geoand
Copy link
Contributor

geoand commented Nov 1, 2022

@gwenneg this sounds reasonable to me. WDYT?

@gwenneg
Copy link
Member

gwenneg commented Nov 1, 2022

I like this global default config idea. It is totally reasonable and a great enhancement.

Note: initial-capacity and maximum-size would configure each cache individually -> will not act as global limits.

@renzodf I'm not sure I understood what you meant here. Would initial-capacity and maximum-size be treated differently than other config keys? A global config value (which would act as a global limit) would make sense to me.

@gwenneg gwenneg self-assigned this Jan 9, 2023
gwenneg added a commit that referenced this issue Jan 24, 2023
Allow global default cache configuration
@quarkus-bot quarkus-bot bot added this to the 2.17 - main milestone Jan 24, 2023
@renzodf
Copy link
Author

renzodf commented Jan 24, 2023

@gwenneg Thanks for the dev :)

@gwenneg
Copy link
Member

gwenneg commented Jan 24, 2023

You're welcome!

@fabrii
Copy link
Contributor

fabrii commented May 24, 2023

Hi @geoand and @gwenneg! This seems to not be working in Quarkus 2.16.7.

Log:

Unrecognized configuration key "quarkus.cache.caffeine.expire-after-write" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo

@geoand
Copy link
Contributor

geoand commented May 24, 2023

It was added in Quarkus 3

@fabrii
Copy link
Contributor

fabrii commented May 24, 2023

Oh, is there any chance to backport it? :)

@geoand
Copy link
Contributor

geoand commented May 24, 2023

Probably not since we don't plan to maintain 2.16 indefinitely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cache kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants