kafka-console-producer implemented in golang and using sarama driver.
- Works with Apache Kafka >= 0.8
- Statically compiled. No dependencies. It run on every linux distribution.
- Just one binary file of ~ 6 Mb
- It produces messages reading from stdin
- It prints state messages in stderr
- Very easy to configure trough environment variables
- Auto discover kafka peers from DNS name
- Waits for kafka to be ready
- Auto reconnect, and retry in case of error
- Log to stderr faulty messages
./kafka-console-producer
Use environment variables
- KAFKA_SERVICE, "kafka", The DNS name for input Kafka broker service
- KAFKA_PORT, "9092", Port to connect to input Kafka peers
- TOPIC, "mytopic", The topic to consume
- PARTITION, "", The partition to produce to. All if not defined.
- VERBOSE, "false, Set to
true
if you want verbose output - KEY, "", The key of produced messages. Default (empty) will produce in every topic
- FINISH_TIMEOUT", "1", Number of seconds to wait for exit after end of line is received
KAFKA_SERVICE=192.168.1.45 TOPIC=foo ./kafka-console-producer
>This is my message 1
>This is my message 2
https://github.com/germanramos/kafka-console-consumer
MIT - German Ramos