Interface DestinationTopicContainer
- All Known Subinterfaces:
DestinationTopicResolver
- All Known Implementing Classes:
DefaultDestinationTopicResolver
public interface DestinationTopicContainer
Provides methods to store and retrieve
DestinationTopic
instances.- Since:
- 2.7
- Author:
- Tomaz Fernandes, Gary Russell, Adrian Chlebosz
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDestinationTopics
(String mainListenerId, List<DestinationTopic> destinationTopics) Adds the provided destination topics to the container.getDestinationTopicByName
(String mainListenerId, String topicName) Returns theDestinationTopic
instance registered for that topic.default DestinationTopic
Deprecated, for removal: This API element is subject to removal in a future version.default DestinationTopic
Returns theDestinationTopic
instance registered as DLT for the given topic taking into consideration the exception thrown, or null if none is found.getNextDestinationTopicFor
(String mainListenerId, String topicName) Returns theDestinationTopic
instance registered as the next destination topic in the chain for the given topic.
-
Method Details
-
addDestinationTopics
Adds the provided destination topics to the container.- Parameters:
mainListenerId
- the listener id.destinationTopics
- theDestinationTopic
list to add.
-
getDestinationTopicByName
Returns theDestinationTopic
instance registered for that topic.- Parameters:
mainListenerId
- the listener id.topicName
- the topic name of the DestinationTopic to be returned.- Returns:
- the DestinationTopic instance registered for that topic.
-
getNextDestinationTopicFor
Returns theDestinationTopic
instance registered as the next destination topic in the chain for the given topic. Note that this might not correspond to the actual next topic a message will be forwarded to, since that depends on different factors. If you need to find out the exact next topic for a message use theDestinationTopicResolver.resolveDestinationTopic(String, String, Integer, Exception, long)
method instead.- Parameters:
mainListenerId
- the listener id.topicName
- the topic name of the DestinationTopic to be returned.- Returns:
- the next DestinationTopic in the chain registered for that topic.
-
getDltFor
@Nullable @Deprecated(since="3.2", forRemoval=true) default DestinationTopic getDltFor(String mainListenerId, String topicName) Deprecated, for removal: This API element is subject to removal in a future version.Replaced bygetDltFor(String, String, Exception)
Returns theDestinationTopic
instance registered as DLT for the given topic, or null if none is found.- Parameters:
mainListenerId
- the listener id.topicName
- the topic name for which to look the DLT for- Returns:
- The
DestinationTopic
instance corresponding to the DLT.
-
getDltFor
@Nullable default DestinationTopic getDltFor(String mainListenerId, String topicName, Exception exc) Returns theDestinationTopic
instance registered as DLT for the given topic taking into consideration the exception thrown, or null if none is found.- Parameters:
mainListenerId
- the listener id.topicName
- the topic name for which to look the DLT forexc
- the exception which is being handled- Returns:
- The
DestinationTopic
instance corresponding to the DLT.
-
getDltFor(String, String, Exception)