Class CachingTopicResolver<T extends Topic>
java.lang.Object
org.springframework.data.redis.listener.support.CachingTopicResolver<T>
- All Implemented Interfaces:
TopicResolver<T>
Caching
TopicResolver variant using a TopicResolver for the actual resolution.
This resolver uses a ConcurrentLruCache to cache resolved topics.
- Since:
- 4.1
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionCachingTopicResolver(int cacheSize, TopicResolver<T> resolver) Create a newCachingTopicResolverwith the givenTopicResolverand cache size. -
Method Summary
-
Constructor Details
-
CachingTopicResolver
Create a newCachingTopicResolverwith the givenTopicResolverand cache size.- Parameters:
cacheSize- cache size.resolver- the actual resolver to resolve topics if not found in cache; must not be null.
-
-
Method Details
-
resolveTopic
Description copied from interface:TopicResolverResolve the given topic name.- Specified by:
resolveTopicin interfaceTopicResolver<T extends Topic>- Parameters:
name- the topic name to resolve.- Returns:
- the resolved topic.
-