Posting compressed content to Kafka REST fails
ahmed-abdulhamid opened this issue · 0 comments
ahmed-abdulhamid commented
ApplicationServer.wrapWithGzipHandler()
does not call GzipHandler.setInflateBufferSize()
causing Kafka REST to fail to process requests with compressed content.
Relevant code
- https://github.com/confluentinc/rest-utils/blob/b275c66b9b3b80a5c431e0648b8d5c5ff9e61f11/core/src/main/java/io/confluent/rest/ApplicationServer.java#L466-L474
- https://github.com/eclipse/jetty.project/blob/c50bed4e65d5cead6f19ffbbf1eb3f27c4cef196/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java#L617-L632
Steps to reproduce
- 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
- 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]