GithubHelp home page GithubHelp logo

elwin / franz Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-ch/franz

1.0 0.0 0.0 125 KB

Your Swiss-Army Knife tool for interacting with Kafka.

License: Apache License 2.0

Go 99.89% Makefile 0.11%

franz's Introduction

franz

Your Swiss-Army Knife tool for interacting with Kafka.

franz provides you various helper tools to work with and debug Kafka such as consuming or producing messages and managing topics or ACLs.

Installation

go get github.com/elwin/franz

Usage

To connect to your Kafka cluster and optionally to a schema registry, franz reads from a configuration file that can be placed in one of the following paths

  • ~/.config/franz
  • /opt/franz/etc
  • any path you wish, passed in using --config /path/to/config A configuration file has roughly the form of config.yml.sample.
$ franz help
Usage:
  franz [command]

Available Commands:
  acls        List and Set Kafka ACLs
  consume     Consume a specific kafka topic
  help        Help about any command
  produce     Produce messages in the specified topic.
  registry    Interact with the schema registry
  status      Show the status of Kafka System
  topics      Manage topics

You can get more information about any command by running franz help [command].

Examples

List relevant information for all Kafka brokers

$ franz status --table
+-------------------------------------------+-----------+--------+---------------------+---------------------+----------+
|                   TOPIC                   | PARTITION | LEADER |      REPLICAS       |         ISR         | INTERNAL |
+-------------------------------------------+-----------+--------+---------------------+---------------------+----------+
| notifications.users                       | 0         | 10364  | 10364, 10363        | 10363, 10364        | false    |
| notifications.users                       | 2         | 10363  | 10363, 10365        | 10363, 10365        | false    |
| notifications.users                       | 1         | 10365  | 10365, 10364        | 10364, 10365        | false    |
| analytics.avro.pageviews                  | 0         | 10365  | 10365, 10363        | 10363, 10365        | false    |
...

Continuously read from a topic

$ franz consume notifications.users --follow
{
  "Topic": "notifications.users",
  "Timestamp": "2020-06-24T09:43:32.443Z",
  "Partition": 3,
  "Key": "...",
  "Value": "...",
  "Offset": 5755325
}
{
  "Topic": "notifications.users",
  "Timestamp": "2020-06-24T09:43:32.443Z",
  "Partition": 2,
  "Key": "...",
  "Value": "...",
  "Offset": 5755326
}
...

Produce Avro Serialized Messages

Find the name of the schema that corresponds to the topic you wish to publish to. By default this is the topic name with a '-value' suffix if it wasn't specified by the Serde.

You can check the schema name by listing the schemas in the registry:

$ franz registry list
[
  "users-value",
  "pageviews-value",
  ...
]

As with the JSON String serialized produce command, start franz reading from stdin by specifying the topic but also specify the schema name with the --encode option Then on subsequent lines submit the JSON equivalent of the messages:

$ franz produce pageviews --encode pageviews-value
{"viewtime": 248888, "userid": "User_99", "pageid": "Page_99"}
...

Contributors

Due to a migration of the codebase, some authors might not show up in the git history even though they contributed to this project:

License

Please see LICENSE.

franz's People

Contributors

elwin avatar lionelfleury avatar els0r avatar pfiaux avatar eliedz avatar nvinzens avatar shastick avatar nooshin-mirzadeh avatar symaras avatar

Stargazers

Jamie Kay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.