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

Ability to add timeout to get operations for Spring HazelcastCache #10756

Closed
gokhanoner opened this issue Jun 14, 2017 · 2 comments
Closed

Ability to add timeout to get operations for Spring HazelcastCache #10756

gokhanoner opened this issue Jun 14, 2017 · 2 comments

Comments

@gokhanoner
Copy link
Contributor

@gokhanoner gokhanoner commented Jun 14, 2017

HazelcastCache on hazelcast-spring project uses map.get() for fetching results. In some cases, users need to define a timeout to guarantee reliable response times.

Hazelcase map as map.getAsync() method that can be used directly but with Spring abstraction, @Cachable annotation, it's not possible. And asking users to use Hazelcast map.getAsync directly will make their code base dependent to Hazelcast.

This can be achieved a couple of ways:

  1. Spring team can add a get(key, timeout) method to org.springframework.cache.Cache and we can implement
    This doesn't seem possible. See: https://jira.spring.io/browse/SPR-15655

  2. We can ask spring team to add a property to their CacheProperties for hazelcast ,which they already have parameters for caching solutions like Infinispan, Couchbase etc.
    https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheProperties.java

This doesn't' seem right because then we'll need to depend on Spring Boot.

  1. We can define a property just for the spring, document it and ask users to define it if they need.

The only think I'm still not sure is, if we should define 1 timeout for all caches, or cache based, so users can choose to define a timeout for some caches and not for some others.

@tombujok
Copy link
Contributor

@tombujok tombujok commented Aug 17, 2017

@gokhanoner I see that the PRs are merged. Can we close this issue?

@gokhanoner
Copy link
Contributor Author

@gokhanoner gokhanoner commented Aug 18, 2017

@tombujok yes we can.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.