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

Add support for Caffeine #238

Closed
vladimir-bukhtoyarov opened this issue Feb 22, 2022 · 3 comments
Closed

Add support for Caffeine #238

vladimir-bukhtoyarov opened this issue Feb 22, 2022 · 3 comments

Comments

@vladimir-bukhtoyarov
Copy link
Collaborator

vladimir-bukhtoyarov commented Feb 22, 2022

It will be useful for bucket per key scenarios when distributed synchronization is unnecessary. Distributed synchronization can it can be unnecessary in the following use cases:

  • Request stickiness is provided by a load balancer.
  • Other use-cases where stickiness can be achieved by the application itself, for example, Kafka consumer.
@pat246
Copy link

pat246 commented Mar 7, 2022

@vladimir-bukhtoyarov found new issue in the version 7.3.0 as below.
Below code gives compile error as The constructor CaffeineProxyManager(Caffeine<Object,Object>, Duration) is undefined

Caffeine<Object, Object> caffeineCacheBuilder = Caffeine.newBuilder();
CaffeineProxyManager proxyManager = new CaffeineProxyManager(caffeineCacheBuilder, Duration.ofMinutes(2));

I am trying to use CaffeineProxyManager to maintain api-key specific buckets using caffein cache.

@vladimir-bukhtoyarov
Copy link
Collaborator Author

@pat246 hello,

Just use proper generic types for cache builder. You can find example in the tests.

@pat246
Copy link

pat246 commented Mar 8, 2022

@vladimir-bukhtoyarov Thanks. example in tests helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants