Package org.springframework.pulsar.core
Interface TopicResolver
- All Known Implementing Classes:
DefaultTopicResolver
public interface TopicResolver
Resolves topics to use when producing or consuming.
- Author:
- Chris Bono
-
Method Summary
Modifier and TypeMethodDescriptionresolveTopic
(String userSpecifiedTopic, Class<?> messageType, Supplier<String> defaultTopicSupplier) Resolve the topic name to use for the given message type.resolveTopic
(String userSpecifiedTopic, Supplier<String> defaultTopicSupplier) Resolve the topic name to use.resolveTopic
(String userSpecifiedTopic, T message, Supplier<String> defaultTopicSupplier) Resolve the topic name to use for the given message.
-
Method Details
-
resolveTopic
Resolved<String> resolveTopic(@Nullable String userSpecifiedTopic, Supplier<String> defaultTopicSupplier) Resolve the topic name to use.- Parameters:
userSpecifiedTopic
- the topic specified by the userdefaultTopicSupplier
- supplies the default topic to use (use a supplier that returnsnull
to signal no default)- Returns:
- the topic to use or
empty
if no topic could be resolved
-
resolveTopic
<T> Resolved<String> resolveTopic(@Nullable String userSpecifiedTopic, @Nullable T message, Supplier<String> defaultTopicSupplier) Resolve the topic name to use for the given message.- Type Parameters:
T
- the message type- Parameters:
userSpecifiedTopic
- the topic specified by the usermessage
- the message instance being produced or consumeddefaultTopicSupplier
- supplies the default topic to use (use a supplier that returnsnull
to signal no default)- Returns:
- the topic to use or
empty
if no topic could be resolved
-
resolveTopic
Resolved<String> resolveTopic(@Nullable String userSpecifiedTopic, @Nullable Class<?> messageType, Supplier<String> defaultTopicSupplier) Resolve the topic name to use for the given message type.- Parameters:
userSpecifiedTopic
- the topic specified by the usermessageType
- the message type being produced or consumeddefaultTopicSupplier
- supplies the default topic to use (use a supplier that returnsnull
to signal no default)- Returns:
- the topic to use or
empty
if no topic could be resolved
-