+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 wTop issues
#181i am getting this error(failed to acquire meta data) and not able to fix it.please help me23 comments · 2019-05-21#343MAC Version : Producer with delimiter problems18 comments · 2021-09-09#172Support OAuthBearer Hooks16 comments · 2019-03-11#309i have a keystore.jks and truststore.jks - how do i connect using kafkacat - which is doesnt support .jks certificates13 comments · 2021-03-16#112Do we have support of kafkacat on windows ?13 comments · 2017-07-28#272Missing messages when consuming12 comments · 2020-10-01#345SASL_SSL: verify failed: broker certificate could not be verified11 comments · 2021-09-30#209Broker DNS resolution failures on macOS9 comments · 2019-11-13
Discussions
#452Print consumed message payload in a single line (no \n)0 comments · 2024-08-07#437Can kcat connect to Confluent Kafka Server using LDAP0 comments · 2023-10-23#433Is there anyway to configure a http proxy?0 comments · 2023-05-31#428Byte array headers support0 comments · 2023-04-14#421mock cluster in continer0 comments · 2023-03-04#385Topic deletion feature0 comments · 2022-07-05#366Allow setting kcat configuration directly from environment variable0 comments · 2022-01-27#334Read avro without schema registry0 comments · 2021-07-29
Latest release
kcat 1.7.0 1.7.0 2021-08-23kafkacat 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