Package org.springframework.kafka.config
Interface KafkaListenerEndpoint
-
- All Known Implementing Classes:
AbstractKafkaListenerEndpoint,MethodKafkaListenerEndpoint,MultiMethodKafkaListenerEndpoint
public interface KafkaListenerEndpointModel for a Kafka listener endpoint. Can be used against aKafkaListenerConfigurerto register endpoints programmatically.- Author:
- Stephane Nicoll, Gary Russell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.BooleangetAutoStartup()Return the autoStartup for this endpoint's container.java.lang.StringgetClientIdPrefix()Return the client id prefix for the container; it will be suffixed by '-n' to provide a unique id when concurrency is used.java.lang.IntegergetConcurrency()Return the concurrency for this endpoint's container.default java.util.PropertiesgetConsumerProperties()Get the consumer properties that will be merged with the consumer properties provided by the consumer factory; properties here will supersede any with the same name(s) in the consumer factory.java.lang.StringgetGroup()Return the group of this endpoint or null if not in a group.java.lang.StringgetGroupId()Return the groupId of this endpoint - if present, overrides thegroup.idproperty of the consumer factory.java.lang.StringgetId()Return the id of this endpoint.TopicPartitionOffset[]getTopicPartitionsToAssign()Return the topicPartitions for this endpoint.java.util.regex.PatterngetTopicPattern()Return the topicPattern for this endpoint.java.util.Collection<java.lang.String>getTopics()Return the topics for this endpoint.booleanisSplitIterables()When true,Iterablereturn results will be split into discrete records.voidsetupListenerContainer(MessageListenerContainer listenerContainer, MessageConverter messageConverter)Setup the specified message listener container with the model defined by this endpoint.
-
-
-
Method Detail
-
getId
java.lang.String getId()
Return the id of this endpoint.- Returns:
- the id of this endpoint. The id can be further qualified when the endpoint is resolved against its actual listener container.
- See Also:
KafkaListenerContainerFactory.createListenerContainer(org.springframework.kafka.config.KafkaListenerEndpoint)
-
getGroupId
java.lang.String getGroupId()
Return the groupId of this endpoint - if present, overrides thegroup.idproperty of the consumer factory.- Returns:
- the group id; may be null.
- Since:
- 1.3
-
getGroup
java.lang.String getGroup()
Return the group of this endpoint or null if not in a group.- Returns:
- the group of this endpoint or null if not in a group.
-
getTopics
java.util.Collection<java.lang.String> getTopics()
Return the topics for this endpoint.- Returns:
- the topics for this endpoint.
-
getTopicPartitionsToAssign
TopicPartitionOffset[] getTopicPartitionsToAssign()
Return the topicPartitions for this endpoint.- Returns:
- the topicPartitions for this endpoint.
- Since:
- 2.3
-
getTopicPattern
java.util.regex.Pattern getTopicPattern()
Return the topicPattern for this endpoint.- Returns:
- the topicPattern for this endpoint.
-
getClientIdPrefix
java.lang.String getClientIdPrefix()
Return the client id prefix for the container; it will be suffixed by '-n' to provide a unique id when concurrency is used.- Returns:
- the client id prefix.
- Since:
- 2.1.1
-
getConcurrency
java.lang.Integer getConcurrency()
Return the concurrency for this endpoint's container.- Returns:
- the concurrency.
- Since:
- 2.2
-
getAutoStartup
java.lang.Boolean getAutoStartup()
Return the autoStartup for this endpoint's container.- Returns:
- the autoStartup.
- Since:
- 2.2
-
getConsumerProperties
@Nullable default java.util.Properties getConsumerProperties()
Get the consumer properties that will be merged with the consumer properties provided by the consumer factory; properties here will supersede any with the same name(s) in the consumer factory.group.idandclient.idare ignored.- Returns:
- the properties.
- Since:
- 2.1.4
- See Also:
ConsumerConfig,getGroupId(),getClientIdPrefix()
-
setupListenerContainer
void setupListenerContainer(MessageListenerContainer listenerContainer, MessageConverter messageConverter)
Setup the specified message listener container with the model defined by this endpoint.This endpoint must provide the requested missing option(s) of the specified container to make it usable. Usually, this is about setting the
queuesand themessageListenerto use but an implementation may override any default setting that was already set.- Parameters:
listenerContainer- the listener container to configuremessageConverter- the message converter - can be null
-
isSplitIterables
boolean isSplitIterables()
When true,Iterablereturn results will be split into discrete records.- Returns:
- true to split.
- Since:
- 2.3.5
-
-