<!-- WARNING: This documentation is auto-generated from the confluentinc/cli repository and should not be manually edited. -->

<a id="confluent-local-kafka-topic-consume"></a>

# confluent local kafka topic consume

#### IMPORTANT
- The [confluent local](https://docs.confluent.io/confluent-cli/current/command-reference/local/index.html) commands are intended for a single-node development environment and
  are not suitable for a production environment. The data that are produced are transient and are intended to be
  temporary. For production-ready workflows, see [Install and Upgrade Confluent Platform](/platform/current/installation/index.html).

## Description

Consume messages from a Kafka topic. Configuration and command guide: [https://docs.confluent.io/confluent-cli/current/cp-produce-consume.html](https://docs.confluent.io/confluent-cli/current/cp-produce-consume.html).

Truncated message headers will be printed if they exist.

```none
confluent local kafka topic consume <topic> [flags]
```

## Flags

```none
    --group string         Consumer group 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)
    --print-key            Print key of the message.
    --timestamp            Print message timestamp in milliseconds.
    --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. For a full list, see https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
    --config-file string   The path to the configuration file for the consumer client, in JSON or Avro format.
```

## Global Flags

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

## Examples

Consume message from topic “test” from the beginning and with keys printed.

```none
confluent local kafka topic consume test --from-beginning --print-key
```

## See Also

* [confluent local kafka topic](index.md#confluent-local-kafka-topic) - Run Kafka topic related commands.
