From 8d15c793f5846f68f18a46ea11f4d0fb785bf995 Mon Sep 17 00:00:00 2001 From: Rigel Bezerra de Melo Date: Fri, 24 Apr 2020 16:42:42 +0100 Subject: [PATCH] Remove spurious topic/partitions existence test when producing. (#655) The Producer will throw an exception if the topic/partition does not exist, and the exception is mapped. Having the produce-to-topic use the AdminClient actually breaks confluent-security-plugins. This is a short-term solution. --- .../kafkarest/resources/v2/PartitionsResource.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/kafka-rest/src/main/java/io/confluent/kafkarest/resources/v2/PartitionsResource.java b/kafka-rest/src/main/java/io/confluent/kafkarest/resources/v2/PartitionsResource.java index 505452562b..4c15a92f18 100644 --- a/kafka-rest/src/main/java/io/confluent/kafkarest/resources/v2/PartitionsResource.java +++ b/kafka-rest/src/main/java/io/confluent/kafkarest/resources/v2/PartitionsResource.java @@ -194,14 +194,7 @@ protected void produce( final int partition, final EmbeddedFormat format, final ProduceRequest request - ) throws Exception { - // If the topic already exists, we can proactively check for the partition - if (topicExists(topic)) { - if (!ctx.getAdminClientWrapper().partitionExists(topic, partition)) { - throw Errors.partitionNotFoundException(); - } - } - + ) { log.trace( "Executing topic produce request id={} topic={} partition={} format={} request={}", asyncResponse, topic, partition, format, request