confluentinc/kafka-rest

Posting compressed content to Kafka REST fails

ahmed-abdulhamid opened this issue · 0 comments

ApplicationServer.wrapWithGzipHandler() does not call GzipHandler.setInflateBufferSize() causing Kafka REST to fail to process requests with compressed content.

Relevant code

Steps to reproduce

  1. Install Confluent Platform
    curl --silent --output docker-compose.yml \
    https://raw.githubusercontent.com/confluentinc/cp-all-in-one/6.1.1-post/cp-all-in-one/docker-compose.yml
    
    docker-compose up -d
    
  2. Produce a message with compressed JSON data (content.json.gz)
    curl --location --request POST 'http://localhost:8082/topics/jsontest' \
    --header 'Content-Type: application/vnd.kafka.json.v2+json' \
    --header 'Content-Encoding: gzip' \
    --data-binary '@content.json.gz'
    

Here's the output:

Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens
 at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 2]