Class KafkaTemplateSpec<K,V> 
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<KafkaTemplateSpec<K,V>, org.springframework.kafka.core.KafkaTemplate<K,V>>
  
org.springframework.integration.kafka.dsl.KafkaTemplateSpec<K,V> 
- Type Parameters:
- K- the key type.
- V- the value type.
- All Implemented Interfaces:
- DisposableBean,- FactoryBean<org.springframework.kafka.core.KafkaTemplate<K,,- V>> - InitializingBean,- Lifecycle,- Phased,- SmartLifecycle
- Direct Known Subclasses:
- KafkaOutboundGatewaySpec.ReplyingKafkaTemplateSpec
public class KafkaTemplateSpec<K,V> 
extends IntegrationComponentSpec<KafkaTemplateSpec<K,V>, org.springframework.kafka.core.KafkaTemplate<K,V>>  
An 
IntegrationComponentSpec implementation for the KafkaTemplate.- Since:
- 5.4
- Author:
- Artem Bilan, Gary Russell
- 
Field SummaryFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpeclogger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Method SummaryModifier and TypeMethodDescriptiondefaultTopic(String defaultTopic) /** Set the default topic for send methods where a topic is not providing.Configure the component identifier.messageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) Set the message converter to use.producerListener(org.springframework.kafka.support.ProducerListener<K, V> producerListener) Set aProducerListenerwhich will be invoked when Kafka acknowledges a send operation.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Method Details- 
getTemplate
- 
idDescription copied from class:IntegrationComponentSpecConfigure the component identifier. Used as thebeanNameto register the bean in the application context for this component.- Overrides:
- idin class- IntegrationComponentSpec<KafkaTemplateSpec<K,- V>, org.springframework.kafka.core.KafkaTemplate<K, - V>> 
- Parameters:
- id- the id.
- Returns:
- the spec.
 
- 
defaultTopic/** Set the default topic for send methods where a topic is not providing.- Parameters:
- defaultTopic- the topic.
- Returns:
- the spec
 
- 
producerListenerpublic KafkaTemplateSpec<K,V> producerListener(org.springframework.kafka.support.ProducerListener<K, V> producerListener) Set aProducerListenerwhich will be invoked when Kafka acknowledges a send operation. By default aLoggingProducerListeneris configured which logs errors only.- Parameters:
- producerListener- the listener; may be- null.
- Returns:
- the spec
 
- 
messageConverterpublic KafkaTemplateSpec<K,V> messageConverter(org.springframework.kafka.support.converter.RecordMessageConverter messageConverter) Set the message converter to use.- Parameters:
- messageConverter- the message converter.
- Returns:
- the spec
 
 
-