Syntax error when configuring Kafka Console Consumer in Windows Console

I’m new to Apache Kafka. I’m trying to run their DemoApp in StreamAPI section and I get the following error in cmd:

The syntax of the command is incorrect.

Here’re the variants I’ve used:

Variant 1:

binwindowskafka-console-consumer.bat --bootstrap-server localhost:9092 --topic streams-wordcount-output --from-beginning --formatter kafka.tools.DefaultMessageFormatter --property print.key=true --property print.value=true

Variant 2:

binwindowskafka-console-consumer.bat --bootstrap-server localhost:9092 --topic streams-wordcount-output --from-beginning --formatter kafka.tools.DefaultMessageFormatter --consumer.config configconsole-consumer.properties

console-consumer.properties contains the same properties as in the first variant.

I’m using Windows 10 with both PowerShell and classic cmd resulting in same error on execution of the batch file.

Here’s the working example (the use Linux):
https://kafka.apache.org/27/documentation/streams/quickstart#quickstart_streams_start

Without formatter and configuration I can’t see the message properly formatted (as obvious :).

Source: Windows Questions

LEAVE A COMMENT