spring-integration icon indicating copy to clipboard operation
spring-integration copied to clipboard

Improve Kafka Reply Topic Logic in the KafkaProducerMessageHandler

Open garyrussell opened this issue 4 years ago • 0 comments

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.

garyrussell avatar Aug 19 '21 15:08 garyrussell