confluent kafka topic consume


Consume messages from a Kafka topic.

Truncated message headers will be printed if they exist.

confluent kafka topic consume <topic> [flags]


    --group string           Consumer group ID. (default "confluent_cli_consumer_<randomly-generated-id>")
-b, --from-beginning         Consume from beginning of the topic.
    --offset int             The offset from the beginning to consume from.
    --partition int32        The partition to consume from. (default -1)
    --value-format string    Format of message value as string, avro, protobuf, or jsonschema. Note that schema references are not supported for avro. (default "string")
    --print-key              Print key of the message.
    --full-header            Print complete content of message headers.
    --delimiter string       The delimiter separating each key and value. (default "\t")
    --config strings         A comma-separated list of configuration overrides ("key=value") for the consumer client.
    --config-file string     The path to the configuration file (in json or avro format) for the consumer client.
    --context-name string    The Schema Registry context under which to lookup schema ID.
    --sr-endpoint string     Endpoint for Schema Registry cluster.
    --sr-api-key string      Schema registry API key.
    --sr-api-secret string   Schema registry API key secret.
    --api-key string         API key.
    --api-secret string      API key secret.
    --cluster string         Kafka cluster ID.
    --context string         CLI context name.
    --environment string     Environment ID.

Global Flags

-h, --help            Show help for this command.
    --unsafe-trace    Equivalent to -vvvv, but also log HTTP requests and responses which may contain plaintext secrets.
-v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).


Consume items from the “my_topic” topic and press “Ctrl+C” to exit.

confluent kafka topic consume -b my_topic

See Also