0

Partitions and dlqName in KafkaConsumerDestination are missing in an application logs if 'spring.cloud.stream.kafka.binder.autoCreateTopics' is false.

By seeing dlqName is empty in KafkaConsumerDestination, I was confused whether or not partitions and dlqName is set properly.

logs when autoCreateTopics is true

logs when autoCreateTopics is true

logs when autoCreateTopics is false

logs when autoCreateTopics is false

Is it intended to exclude 'partitions' and 'dlqName' in KafkaConsumerDestination when autoCreateTopics is set to false?

After some research, it seems the reason why partitions and dlqName are not set is that 'createDlqIfNeedBe' method is not reachable when autoCreateTopics is false. I think it is natural not to create DlT by a binder when autoCreateTopics is false. Is it possible KafkaConsumerDestination maintains partitions and dlqName in that case?

KafkaTopicProvisioner doProvisionConsumerDestination

https://github.com/spring-cloud/spring-cloud-stream/blob/bf75046fb1e2fd9b20d9672aa89657e243c7586c/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java#L219-L242

KafkaTopicProvisioner createDlqIfNeedBe

https://github.com/spring-cloud/spring-cloud-stream/blob/bf75046fb1e2fd9b20d9672aa89657e243c7586c/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/KafkaTopicProvisioner.java#L315-L343

0 Answers0