|
|
|
@ -58,33 +58,33 @@ class KafkaAnnotationDrivenConfiguration {
|
|
|
|
|
|
|
|
|
|
private final KafkaAwareTransactionManager<Object, Object> transactionManager;
|
|
|
|
|
|
|
|
|
|
private final ConsumerAwareRebalanceListener rebalanceListener;
|
|
|
|
|
|
|
|
|
|
private final ErrorHandler errorHandler;
|
|
|
|
|
|
|
|
|
|
private final BatchErrorHandler batchErrorHandler;
|
|
|
|
|
|
|
|
|
|
private final AfterRollbackProcessor<Object, Object> afterRollbackProcessor;
|
|
|
|
|
|
|
|
|
|
private final ConsumerAwareRebalanceListener rebalanceListener;
|
|
|
|
|
|
|
|
|
|
KafkaAnnotationDrivenConfiguration(KafkaProperties properties,
|
|
|
|
|
ObjectProvider<RecordMessageConverter> messageConverter,
|
|
|
|
|
ObjectProvider<BatchMessageConverter> batchMessageConverter,
|
|
|
|
|
ObjectProvider<KafkaTemplate<Object, Object>> kafkaTemplate,
|
|
|
|
|
ObjectProvider<KafkaAwareTransactionManager<Object, Object>> kafkaTransactionManager,
|
|
|
|
|
ObjectProvider<ConsumerAwareRebalanceListener> rebalanceListener,
|
|
|
|
|
ObjectProvider<ErrorHandler> errorHandler,
|
|
|
|
|
ObjectProvider<BatchErrorHandler> batchErrorHandler,
|
|
|
|
|
ObjectProvider<AfterRollbackProcessor<Object, Object>> afterRollbackProcessor,
|
|
|
|
|
ObjectProvider<ConsumerAwareRebalanceListener> rebalanceListener) {
|
|
|
|
|
ObjectProvider<AfterRollbackProcessor<Object, Object>> afterRollbackProcessor) {
|
|
|
|
|
this.properties = properties;
|
|
|
|
|
this.messageConverter = messageConverter.getIfUnique();
|
|
|
|
|
this.batchMessageConverter = batchMessageConverter.getIfUnique(
|
|
|
|
|
() -> new BatchMessagingMessageConverter(this.messageConverter));
|
|
|
|
|
this.kafkaTemplate = kafkaTemplate.getIfUnique();
|
|
|
|
|
this.transactionManager = kafkaTransactionManager.getIfUnique();
|
|
|
|
|
this.rebalanceListener = rebalanceListener.getIfUnique();
|
|
|
|
|
this.errorHandler = errorHandler.getIfUnique();
|
|
|
|
|
this.batchErrorHandler = batchErrorHandler.getIfUnique();
|
|
|
|
|
this.afterRollbackProcessor = afterRollbackProcessor.getIfUnique();
|
|
|
|
|
this.rebalanceListener = rebalanceListener.getIfUnique();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@ -97,10 +97,10 @@ class KafkaAnnotationDrivenConfiguration {
|
|
|
|
|
configurer.setMessageConverter(messageConverterToUse);
|
|
|
|
|
configurer.setReplyTemplate(this.kafkaTemplate);
|
|
|
|
|
configurer.setTransactionManager(this.transactionManager);
|
|
|
|
|
configurer.setRebalanceListener(this.rebalanceListener);
|
|
|
|
|
configurer.setErrorHandler(this.errorHandler);
|
|
|
|
|
configurer.setBatchErrorHandler(this.batchErrorHandler);
|
|
|
|
|
configurer.setAfterRollbackProcessor(this.afterRollbackProcessor);
|
|
|
|
|
configurer.setRebalanceListener(this.rebalanceListener);
|
|
|
|
|
return configurer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|