Sign inSign up

siriuszg/kafka-consumer

By siriuszg

•Updated over 6 years ago

Image
0

582

siriuszg/kafka-consumer repository overview

⁠Kafka Consumer

Api extensions for Sarama⁠, Sarama is an MIT-licensed Go client library for Apache Kafka version 0.8 (and later).

⁠More Documentation

Kafka quick start documentation at kafka.apache.org⁠

⁠Docker Command

docker run -d -p 3000:3000 --restart=always -e KAFKA_BROKERS="kafka:9092" --name kafka-consumer siriuszg/kafka-consumer:TAG
  • set environment ENABLE_PRODUCER="true" bind producer api
    • auto send message to topic
    • just for test

⁠Http Request

⁠Producer
curl 'http://localhost:3000/v1/producer?topic=test&count=1'
⁠Consumer
curl 'http://localhost:3000/v1/consumer?topics=test&initial=new&count=10'
⁠Consumer Query Param
  • topics
    • REQUIRED
    • type: string
    • kafka topic name, multiple topic split by ','
  • initial
    • REQUIRED
    • type: string
    • value: 'old' or 'new'
    • kafka message initial offset from oldest or newest
  • count
    • REQUIRED
    • type: int
    • kafka message count
  • group
    • type: string
    • kafka consumer group
  • filter
    • type: string
    • only return kafka message contains this value
  • commit
    • type: string
    • value: '1' or '0'
    • set '1' is kafka consumer mark offset

⁠Console Color

  • 格式:

    • \033[显示方式;前景色;背景色m
    • \x1b[显示方式;前景色%s\x1b[0m
  • 说明:

    前景色背景色颜色
    3040黑色
    3141红色
    3242绿色
    3343黃色
    3444蓝色
    3545紫红色
    3646青蓝色
    3747白色
    显示方式意义
    0终端默认设置
    1高亮显示
    4使用下划线
    5闪烁
    7反白显示
    8不可见

Tag summary

Content type

Image

Digest

Size

10.6 MB

Last updated

over 6 years ago

docker pull siriuszg/kafka-consumer