Search code examples
apache-kafkadocker-composeavroconfluent-schema-registryproducer

Can not produce with dockerized producer into Kafka


Did anyone encounter this error ?

io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); line: 1, column: 2]; error code: 50005\n\tat io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:226)

I have this stack trace when I try to produce messages into kafka.

FYI, the kafka stack (kaka, schema-registry and zookeeper) and the producer are dockerized with a docker-compose file.

Any help is appreciated !


Solution

  • I'm using a proxy, I added my IP address to http.nonProxyHosts and it works. The problem was the schema-registry returning HTML rather than JSON, that's why I had this annoying error.