@ -29,6 +29,7 @@ import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.KafkaTemplate ;
import org.springframework.kafka.listener.AfterRollbackProcessor ;
import org.springframework.kafka.listener.BatchErrorHandler ;
import org.springframework.kafka.listener.ConsumerAwareRebalanceListener ;
import org.springframework.kafka.listener.ErrorHandler ;
import org.springframework.kafka.support.converter.BatchMessageConverter ;
import org.springframework.kafka.support.converter.BatchMessagingMessageConverter ;
@ -63,6 +64,8 @@ class KafkaAnnotationDrivenConfiguration {
private final AfterRollbackProcessor < Object , Object > afterRollbackProcessor ;
private final ConsumerAwareRebalanceListener rebalanceListener ;
KafkaAnnotationDrivenConfiguration ( KafkaProperties properties ,
ObjectProvider < RecordMessageConverter > messageConverter ,
ObjectProvider < BatchMessageConverter > batchMessageConverter ,
@ -70,7 +73,8 @@ class KafkaAnnotationDrivenConfiguration {
ObjectProvider < KafkaAwareTransactionManager < Object , Object > > kafkaTransactionManager ,
ObjectProvider < ErrorHandler > errorHandler ,
ObjectProvider < BatchErrorHandler > batchErrorHandler ,
ObjectProvider < AfterRollbackProcessor < Object , Object > > afterRollbackProcessor ) {
ObjectProvider < AfterRollbackProcessor < Object , Object > > afterRollbackProcessor ,
ObjectProvider < ConsumerAwareRebalanceListener > rebalanceListener ) {
this . properties = properties ;
this . messageConverter = messageConverter . getIfUnique ( ) ;
this . batchMessageConverter = batchMessageConverter . getIfUnique (
@ -80,6 +84,7 @@ class KafkaAnnotationDrivenConfiguration {
this . errorHandler = errorHandler . getIfUnique ( ) ;
this . batchErrorHandler = batchErrorHandler . getIfUnique ( ) ;
this . afterRollbackProcessor = afterRollbackProcessor . getIfUnique ( ) ;
this . rebalanceListener = rebalanceListener . getIfUnique ( ) ;
}
@Bean
@ -95,6 +100,7 @@ class KafkaAnnotationDrivenConfiguration {
configurer . setErrorHandler ( this . errorHandler ) ;
configurer . setBatchErrorHandler ( this . batchErrorHandler ) ;
configurer . setAfterRollbackProcessor ( this . afterRollbackProcessor ) ;
configurer . setRebalanceListener ( this . rebalanceListener ) ;
return configurer ;
}