November 2016
Intermediate to advanced
944 pages
21h 1m
English
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:

Read now
Unlock full access