K
- the key type.V
- the value type.public class KafkaTemplateSpec<K,V> extends IntegrationComponentSpec<KafkaTemplateSpec<K,V>,org.springframework.kafka.core.KafkaTemplate<K,V>>
IntegrationComponentSpec
implementation for the KafkaTemplate
.PARSER, target
logger
DEFAULT_PHASE
OBJECT_TYPE_ATTRIBUTE
Modifier and Type | Method and Description |
---|---|
KafkaTemplateSpec<K,V> |
defaultTopic(String defaultTopic)
/**
Set the default topic for send methods where a topic is not
providing.
|
org.springframework.kafka.core.KafkaTemplate<K,V> |
getTemplate() |
KafkaTemplateSpec<K,V> |
id(String id)
Configure the component identifier.
|
KafkaTemplateSpec<K,V> |
messageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)
Set the message converter to use.
|
KafkaTemplateSpec<K,V> |
producerListener(org.springframework.kafka.support.ProducerListener<K,V> producerListener)
Set a
ProducerListener which will be invoked when Kafka acknowledges
a send operation. |
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stop
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
public KafkaTemplateSpec<K,V> id(String id)
IntegrationComponentSpec
beanName
to register the
bean in the application context for this component.id
in class IntegrationComponentSpec<KafkaTemplateSpec<K,V>,org.springframework.kafka.core.KafkaTemplate<K,V>>
id
- the id.public KafkaTemplateSpec<K,V> defaultTopic(String defaultTopic)
defaultTopic
- the topic.public KafkaTemplateSpec<K,V> producerListener(org.springframework.kafka.support.ProducerListener<K,V> producerListener)
ProducerListener
which will be invoked when Kafka acknowledges
a send operation. By default a LoggingProducerListener
is configured
which logs errors only.producerListener
- the listener; may be null
.public KafkaTemplateSpec<K,V> messageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter)
messageConverter
- the message converter.