The check point

In this chapter, we created two new configurations: AsyncConfiguration, which will allow us to use the @Async annotation to submit tasks to an executor, and CacheConfiguration, which will create a CacheManager interface and allow us to use the @Cacheable annotation. Since we can use Redis as a cache manager, we also amended the RedisConfig class.

We created a SearchCache class, which contained a cache of tweets, and we now have two TwitterSearch implementations to choose from: good old SearchService, which will fetch each result synchronously, and ParallelSearchService, which will issue each query in a different thread:

The check point

Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.