spring-integration
spring-integration copied to clipboard
Improve Kafka Reply Topic Logic in the KafkaProducerMessageHandler
Currently:
if (replyTopic == null) {
if (this.replyTopicsAndPartitions.size() == 1) {
replyTopic = getSingleReplyTopic();
}
else {
throw new IllegalStateException("No reply topic header and no default reply topic can be determined");
}
}
However, the ReplyingKafkaTemplate could have already determined a default reply topic - this will need a change to the template to expose its default (if present).
The current mechanism (determineValidReplyTopicsAndPartitions()) does not work because the partition might not have yet been assigned.