Package org.springframework.kafka.config
Class MultiMethodKafkaListenerEndpoint<K,V>
java.lang.Object
org.springframework.kafka.config.AbstractKafkaListenerEndpoint<K,V>
org.springframework.kafka.config.MethodKafkaListenerEndpoint<K,V>
org.springframework.kafka.config.MultiMethodKafkaListenerEndpoint<K,V>
- Type Parameters:
K
- the key type.V
- the value type.
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,InitializingBean
,KafkaListenerEndpoint
The
MethodKafkaListenerEndpoint
extension for several POJO methods
based on the KafkaHandler
.- Author:
- Gary Russell, Wang Zhiyang
- See Also:
-
Constructor Summary
ConstructorDescriptionMultiMethodKafkaListenerEndpoint
(List<Method> methods, Method defaultMethod, Object bean) Construct an instance for the provided methods, default method and bean. -
Method Summary
Modifier and TypeMethodDescriptionprotected HandlerAdapter
configureListenerAdapter
(MessagingMessageListenerAdapter<K, V> messageListener) Create aHandlerAdapter
for this listener adapter.Get a default method.Get a method list.void
setDefaultMethod
(Method defaultMethod) Set a default method.void
setMethods
(List<Method> methods) Set a method list.void
setValidator
(Validator validator) Set a payload validator.Methods inherited from class org.springframework.kafka.config.MethodKafkaListenerEndpoint
createMessageListener, createMessageListenerInstance, getBean, getEndpointDescription, getMessageHandlerMethodFactory, getMethod, setBean, setErrorHandler, setMessageHandlerMethodFactory, setMessagingConverter, setMethod
Methods inherited from class org.springframework.kafka.config.AbstractKafkaListenerEndpoint
afterPropertiesSet, getAutoStartup, getBatchListener, getBatchToRecordAdapter, getBeanExpressionContext, getBeanFactory, getBeanResolver, getClientIdPrefix, getConcurrency, getConsumerProperties, getContainerPostProcessor, getGroup, getGroupId, getId, getListenerInfo, getMainListenerId, getRecordFilterStrategy, getReplyTemplate, getResolver, getTopicPartitionsToAssign, getTopicPattern, getTopics, isAckDiscarded, isBatchListener, isSplitIterables, setAckDiscarded, setAutoStartup, setBatchListener, setBatchToRecordAdapter, setBeanFactory, setClientIdPrefix, setConcurrency, setConsumerProperties, setContainerPostProcessor, setCorrelationHeaderName, setGroup, setGroupId, setId, setListenerInfo, setMainListenerId, setRecordFilterStrategy, setReplyHeadersConfigurer, setReplyTemplate, setSplitIterables, setTopicPartitions, setTopicPattern, setTopics, setupListenerContainer, toString
-
Constructor Details
-
MultiMethodKafkaListenerEndpoint
public MultiMethodKafkaListenerEndpoint(List<Method> methods, @Nullable Method defaultMethod, Object bean) Construct an instance for the provided methods, default method and bean.- Parameters:
methods
- the methods.defaultMethod
- the default method.bean
- the bean.- Since:
- 2.1.3
-
-
Method Details
-
getMethods
Get a method list.- Returns:
- the method list.
- Since:
- 3.2
-
setMethods
Set a method list.- Parameters:
methods
- the methods.- Since:
- 3.2
-
getDefaultMethod
Get a default method.- Returns:
- the default method.
- Since:
- 3.2
-
setDefaultMethod
Set a default method.- Parameters:
defaultMethod
- the default method.- Since:
- 3.2
-
setValidator
Set a payload validator.- Parameters:
validator
- the validator.- Since:
- 2.5.11
-
configureListenerAdapter
protected HandlerAdapter configureListenerAdapter(MessagingMessageListenerAdapter<K, V> messageListener) Description copied from class:MethodKafkaListenerEndpoint
Create aHandlerAdapter
for this listener adapter.- Overrides:
configureListenerAdapter
in classMethodKafkaListenerEndpoint<K,
V> - Parameters:
messageListener
- the listener adapter.- Returns:
- the handler adapter.
-