edenhill /kcat

Generic command line non-JVM Apache Kafka producer and consumer

★ 5,793⑂ 498👁 70⑃ 103● 357▤ 9
CNOASSERTIONCreated 2014-03-30
下载:kcat 1.7.0kcat-1.7.0 ↓1.7.02021-08-23
+0
日增长
5,793
stars
498
forks
70
watchers
103
prs
357
issues
9
releases

README

!logo by @dtrapezoid

 kcat

kcat is the project formerly known as as kafkacat

kcat and kafkacat are Copyright (c) 2014-2021 Magnus Edenhill

https://github.com/edenhill/kcat

kcat logo by @dtrapezoid


 What is kcat

kcat is a generic non-JVM producer and consumer for Apache Kafka =0.8,
think of it as a netcat for Kafka.

In producer mode kcat reads messages from stdin, delimited with a
configurable delimiter (-D, defaults to newline), and produces them to the
provided Kafka cluster (-b), topic (-t) and partition (-p).

In consumer mode kcat reads messages from a topic and partition and
prints them to stdout using the configured message delimiter.

There's also support for the Kafka =0.9 high-level balanced consumer, use
the -G  switch and provide a list of topics to join the group.

kcat also features a Metadata list (-L) mode to display the current
state of the Kafka cluster and its topics and partitions.

Supports Avro message deserialization using the Confluent Schema-Registry,
and generic primitive deserializers (see examples below).

kcat is fast and lightweight; statically linked it is no more than 150Kb.

 What happened to kafkacat?

kcat is kafkacat. The kafkacat project was renamed to kcat in August 2021
to adhere to the Apache Software Foundation's (ASF) trademark policies.
Apart from the name, nothing else was changed.


 Try it out with docker

bash
 List brokers and topics in cluster
$ docker run -it --network=host edenhill/kcat:1.7.1 -b YOUR_BROKER -L


See Examples for usage options, and Running in Docker for more information on how to properly run docker-based clients with Kafka.


 Install

 On recent enough Debian systems:


apt-get install kafkacat


On recent openSUSE systems:


zypper addrepo https://download.opensuse.org/repositories/network:utilities/openSUSE_Factory/network:utilities.repo
zypper refresh
zypper install kafkacat

(see this page for instructions to install with openSUSE LEAP)

 On Mac OS X with homebrew installed:


brew install kcat


 On Fedora


 dnf copr enable bvn13/kcat
 dnf update
 dnf install kafkacat


See this blog for how to build from sources and install kafkacat/kcat on recent Fedora systems.


 Otherwise follow directions below


 Requirements

  librdkafka - https://github.com/edenhill/librdkafka
  libyajl (for JSON support, optional)
  libavro-c and libserdes (for Avro support, optional. See https://github.com/confluentinc/libserdes)

On Ubuntu or Debian: sudo apt-get install librdkafka-dev libyajl-dev

 Build

    ./configure 
    make
    sudo make install

 Build for Windows

    cd win32
    nuget restore
    msbuild

NOTE: Requires Build Tools for Visual Studio 2017 with components Windows 8.1 SDK and VC++ 2015.3 v14.00 (v140) toolset to be installed.

 Quick build

The bootstrap.sh build script will download and build the required dependencies,
providing a quick and easy means of building kcat.
Internet connectivity and wget/curl is required by this script.
The resulting kcat binary w

Top issues

Discussions

Latest release

kcat 1.7.0 1.7.0 2021-08-23
kafkacat has been renamed to kcat to adhere to the Apache Software Foundation's (ASF) trademark policies.

  kafkacat is now called kcat.
  Add support for multibyte delimiters to -D and -K (140, 280)
  Add support for -X partition.assignment.strategy=cooperative-sticky incremental rebalancing.
  High-level consumer -G now supports exit-on-eof -e option (86)
  Avro consumer with -J will now emit key_schema_id and value_schema_id.

 Upgrade considerations

  Please rename any kafkacat.conf config files to kcat.conf.
   The old path will continue to work for some time but a warning wi

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON