Giter Site home page Giter Site logo

kafka-faker's Introduction

Kafka Faker

Kafka Faker is a fake message generator for kafka. It generates fake messages based on a schema and sends them to a kafka topic.

It's useful for a service that consumes messages from kafka, stream processing with tools (e.g. Apache Flink) or testing.

Configuration

kafka:
  brokers: localhost:29092
generators:
  - topic: sample_topic
    partitionKey: any
    template: |-
      {
        "name": "{{ personName }}",
        "email": "{{ email }}",
        "from_address": "{{ ethereumAddress }}",
        "to_address": "{{ ethereumAddress }}",
        "amount": "{{ intBetween 1 1000 }}",
        "timestamp": "{{ timestamp }}"
      }
    number: 5
    loop: true
    delay: 2s

Test

First of all, you need to run kafka to test this app locally. Use docker-compose to run kafka and kafka-ui.

$ docker-compose up -d

Then, build & run kafka-faker with the config file.

$ go build -o ./bin/kafka-faker .
$ ./bin/kafka-faker --config-file=config.yml

Generated messages shows on kafka-ui

Visit kafka-ui to see the generated messages. If you use docker-compose file. you can visit the kafka-ui at http://localhost:8080/

LICENSE

MIT

kafka-faker's People

Contributors

scalalang2 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.