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

Possibility to use org.springframework.cache.support.NoOpCacheManager.NoOpCache as public class as NoOpCacheManager [SPR-14856] #19422

Closed
spring-projects-issues opened this issue Oct 26, 2016 · 2 comments

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 26, 2016

Alexandre Navarro opened SPR-14856 and commented

Possibility to use org.springframework.cache.support.NoOpCacheManager.NoOpCache as public class as NoOpCacheManager.

I just explain my use case to use NoOpCache as a client.

I configure some caches via in my spring-boot microservice.
Some are server side, some are client side via interface designed with feign/spring-cloud annotation and @Cacheable
For server side, I want always to use cache.
For client side, depending of my microservice, I want to activate or not some caches, for instance, on a spring-batch microservice I want to cache. Just for information, my different interface of my feign client with @Cacheable are shared between the different microservices via client jar of my microservice.

So my configuration should be in some case like

    @Bean
    public CacheManager cacheManager() {
        final SimpleCacheManager cacheManager = new SimpleCacheManager();
        cacheManager.setCaches(Arrays.asList(
                new NoOpCacheManager.NoOpCache("bar"),
                new ConcurrentMapCache("foo")));
        return cacheManager;
    }

Can you just see NoOpCache as public class or have something close.
Of course, I can have a basic NoOpCache on my side but it should be by default in spring-cache.


Affects: 4.3.3

Referenced from: commits ffa728c, 1c44335

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 27, 2016

Juergen Hoeller commented

Stéphane Nicoll, let's simply move NoOpCache to a top-level class in cache.support...

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Oct 27, 2016

Stéphane Nicoll commented

NoOpCache is now a top-level public class. Thanks!

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
2 participants