Package org.springframework.kafka.config
Interface KafkaListenerEndpoint
- All Known Implementing Classes:
AbstractKafkaListenerEndpoint
,MethodKafkaListenerEndpoint
,MultiMethodKafkaListenerEndpoint
public interface KafkaListenerEndpoint
Model for a Kafka listener endpoint. Can be used against a
KafkaListenerConfigurer
to register endpoints programmatically.- Author:
- Stephane Nicoll, Gary Russell
-
Method Summary
Modifier and TypeMethodDescriptionReturn the autoStartup for this endpoint's container.default Boolean
Return the current batch listener flag for this endpoint, or null if not explicitly set.Return the client id prefix for the container; it will be suffixed by '-n' to provide a unique id when concurrency is used.Return the concurrency for this endpoint's container.default Properties
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.default ContainerPostProcessor<?,
?, ?> Return theContainerPostProcessor
for this endpoint, or null if not explicitly set.getGroup()
Return the group of this endpoint or null if not in a group.Return the groupId of this endpoint - if present, overrides thegroup.id
property of the consumer factory.getId()
Return the id of this endpoint.default byte[]
Get the listener info to insert in the record header.default String
Return the main listener id if this container is for a retry topic.Return the topicPartitions for this endpoint.Return the topicPattern for this endpoint.Return the topics for this endpoint.boolean
When true,Iterable
return results will be split into discrete records.void
setupListenerContainer
(MessageListenerContainer listenerContainer, MessageConverter messageConverter) Setup the specified message listener container with the model defined by this endpoint.
-
Method Details
-
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:
-
getGroupId
Return the groupId of this endpoint - if present, overrides thegroup.id
property of the consumer factory.- Returns:
- the group id; may be null.
- Since:
- 1.3
-
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
Collection<String> getTopics()Return the topics for this endpoint.- Returns:
- the topics for this endpoint.
-
getTopicPartitionsToAssign
Return the topicPartitions for this endpoint.- Returns:
- the topicPartitions for this endpoint.
- Since:
- 2.3
-
getTopicPattern
Return the topicPattern for this endpoint.- Returns:
- the topicPattern for this endpoint.
-
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
Return the concurrency for this endpoint's container.- Returns:
- the concurrency.
- Since:
- 2.2
-
getAutoStartup
Return the autoStartup for this endpoint's container.- Returns:
- the autoStartup.
- Since:
- 2.2
-
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.id
andclient.id
are ignored.- Returns:
- the properties.
- Since:
- 2.1.4
- See Also:
-
ConsumerConfig
getGroupId()
getClientIdPrefix()
-
setupListenerContainer
void setupListenerContainer(MessageListenerContainer listenerContainer, @Nullable 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
queues
and themessageListener
to 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,Iterable
return results will be split into discrete records.- Returns:
- true to split.
- Since:
- 2.3.5
-
getListenerInfo
Get the listener info to insert in the record header.- Returns:
- the info.
- Since:
- 2.8.4
-
getMainListenerId
Return the main listener id if this container is for a retry topic.- Returns:
- the main listener id or null.
- Since:
- 3.0
-
getBatchListener
Return the current batch listener flag for this endpoint, or null if not explicitly set.- Returns:
- the batch listener flag.
- Since:
- 2.9.6
-
getContainerPostProcessor
Return theContainerPostProcessor
for this endpoint, or null if not explicitly set.- Returns:
- the container post processor.
- Since:
- 3.1
-