Improve Kafka Exception Message

- when we can't determine reply topic
This commit is contained in:
Gary Russell
2022-11-15 14:41:39 -05:00
parent 88e259ccf2
commit 77a752934d
3 changed files with 8 additions and 3 deletions

View File

@@ -626,7 +626,8 @@ public class KafkaProducerMessageHandler<K, V> extends AbstractReplyProducingMes
replyTopic = getSingleReplyTopic();
}
else {
throw new IllegalStateException("No reply topic header and no default reply topic can be determined");
throw new IllegalStateException("No reply topic header and no default reply topic can be determined; "
+ "container's assigned partitions: " + this.replyTopicsAndPartitions);
}
}
else {

View File

@@ -459,7 +459,9 @@ public class KafkaDslTests {
@Override
public void onPartitionsAssigned(Collection<TopicPartition> partitions) {
ContextConfiguration.this.replyContainerLatch.countDown();
if (!partitions.isEmpty()) {
ContextConfiguration.this.replyContainerLatch.countDown();
}
}
});

View File

@@ -345,7 +345,9 @@ class KafkaDslKotlinTests {
}
override fun onPartitionsAssigned(partitions: Collection<TopicPartition>) {
this@ContextConfiguration.replyContainerLatch.countDown()
if (!partitions.isEmpty()) {
this@ContextConfiguration.replyContainerLatch.countDown()
}
}
})