@ -29,6 +29,7 @@ import org.springframework.kafka.core.ConsumerFactory;
@@ -29,6 +29,7 @@ import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory ;
import org.springframework.kafka.core.KafkaTemplate ;
import org.springframework.kafka.listener.AfterRollbackProcessor ;
import org.springframework.kafka.listener.BatchInterceptor ;
import org.springframework.kafka.listener.CommonErrorHandler ;
import org.springframework.kafka.listener.ConsumerAwareRebalanceListener ;
import org.springframework.kafka.listener.RecordInterceptor ;
@ -44,6 +45,7 @@ import org.springframework.kafka.transaction.KafkaAwareTransactionManager;
@@ -44,6 +45,7 @@ import org.springframework.kafka.transaction.KafkaAwareTransactionManager;
*
* @author Gary Russell
* @author Eddú Meléndez
* @author Thomas Kåsene
* /
@Configuration ( proxyBeanMethods = false )
@ConditionalOnClass ( EnableKafka . class )
@ -69,6 +71,8 @@ class KafkaAnnotationDrivenConfiguration {
@@ -69,6 +71,8 @@ class KafkaAnnotationDrivenConfiguration {
private final RecordInterceptor < Object , Object > recordInterceptor ;
private final BatchInterceptor < Object , Object > batchInterceptor ;
KafkaAnnotationDrivenConfiguration ( KafkaProperties properties ,
ObjectProvider < RecordMessageConverter > messageConverter ,
ObjectProvider < RecordFilterStrategy < Object , Object > > recordFilterStrategy ,
@ -78,7 +82,8 @@ class KafkaAnnotationDrivenConfiguration {
@@ -78,7 +82,8 @@ class KafkaAnnotationDrivenConfiguration {
ObjectProvider < ConsumerAwareRebalanceListener > rebalanceListener ,
ObjectProvider < CommonErrorHandler > commonErrorHandler ,
ObjectProvider < AfterRollbackProcessor < Object , Object > > afterRollbackProcessor ,
ObjectProvider < RecordInterceptor < Object , Object > > recordInterceptor ) {
ObjectProvider < RecordInterceptor < Object , Object > > recordInterceptor ,
ObjectProvider < BatchInterceptor < Object , Object > > batchInterceptor ) {
this . properties = properties ;
this . messageConverter = messageConverter . getIfUnique ( ) ;
this . recordFilterStrategy = recordFilterStrategy . getIfUnique ( ) ;
@ -90,6 +95,7 @@ class KafkaAnnotationDrivenConfiguration {
@@ -90,6 +95,7 @@ class KafkaAnnotationDrivenConfiguration {
this . commonErrorHandler = commonErrorHandler . getIfUnique ( ) ;
this . afterRollbackProcessor = afterRollbackProcessor . getIfUnique ( ) ;
this . recordInterceptor = recordInterceptor . getIfUnique ( ) ;
this . batchInterceptor = batchInterceptor . getIfUnique ( ) ;
}
@Bean
@ -107,6 +113,7 @@ class KafkaAnnotationDrivenConfiguration {
@@ -107,6 +113,7 @@ class KafkaAnnotationDrivenConfiguration {
configurer . setCommonErrorHandler ( this . commonErrorHandler ) ;
configurer . setAfterRollbackProcessor ( this . afterRollbackProcessor ) ;
configurer . setRecordInterceptor ( this . recordInterceptor ) ;
configurer . setBatchInterceptor ( this . batchInterceptor ) ;
return configurer ;
}