schema-registry
schema-registry copied to clipboard
kafka-avro-console-consumer not honoring print.offset, print.partition, or print.headers
--property print.offset=true --property print.partition=true --property print.headers=true
all of these properties are ignored by kafka-avro-console-consumer
They aren't accepted, not "ignored"
ref. https://github.com/confluentinc/schema-registry/blob/master/schema-serializer/src/main/java/io/confluent/kafka/formatter/SchemaMessageFormatter.java#L46-L50
Ok, but kafka-console-consumer does accept them.
Last I checked, there was no easy way to extend the DefaultMessageFormatter to accept the same fields. without duplicating all the same checks and property extraction.
That may have changed after https://github.com/apache/kafka/commit/c77183dbb323d1aa4b72ebcfedeac9947c3c76d0
help seems to indicate it accepts these parameters , however offset is not printed
kafka-avro-console-consumer --help This tool helps to read data from Kafka topics and outputs it to standard output. Option Description
--bootstrap-server <String: server to REQUIRED: The server(s) to connect to. connect to> specified. --property <String: prop> The properties to initialize the message formatter. Default properties include: print.timestamp=true|false print.key=true|false print.offset=true|false print.partition=true|false print.headers=true|false
Is there any update on this? I'm using 7.2.1 and the issue seems to still be there.
Hello...
I'm testing with 7.4.1 ... when consuming messages with headers (produced with kafka-avro-console-producer) I can see the headers properly with the standard 'kafka-console-consumer' (and in C3) but the 'kafka-avro-console-consumer' displays "null" for the values of the header keys...
Using "kafka-avro-console-consumer"
But "kafka-console-consumer"
Try adding --property headers.deserializer=org.apache.kafka.common.serialization.StringDeserializer