用于API的Kafka命令生成消息,创建使用者组,订阅使用者组并读取记录 [英] Kafka commands for API to produce message, create consumer group, subscribe to consumer group and read records
问题描述
我正在使用以下命令来生成和创建消费者组,面临着未创建消费者组的问题.你能帮忙吗?.
I'm using below commands to produce and create consumer groups, facing issue with consumer group not being created,. Can you please help..?
kafka-producer-perf-test --topic test-one --throughput 1000 --record-size 50 --num-records 10 --producer-props bootstrap.servers='localhost:9092' --producer.config producer.properties
kafka-consumer-perf-test --consumer.config consumer.properties --bootstrap-servers='localhost:9092' --topic test-one --messages 1
Command可以生成一条消息,但无法创建使用者组并订阅主题,而所生成的消息被其他某个主题所使用.
Command is able to produce a message but unable to create a consumer group and subscribe to topic instead produced message is consumed by some other topic.
推荐答案
该命令kafka-producer-perf-test
仅旨在作为在群集上运行的自包含性能测试.
That command, kafka-producer-perf-test
is only intended to be a self-contained performance test to run on a cluster.
对于您来说,看起来像这样的Kafka快速入门会是一个更好的起点:
It seems something like this Kafka quickstart would be a much better starting point for you:
https://kafka.apache.org/quickstart
链接中有更多详细信息,但摘要:
There's more details in the link, but in summary:
-
产生消息:
To produce messages:
- kafka-console-producer.sh --bootstrap-server localhost:9092 --topic测试
要消费消息:
- kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic测试--from-beginning
这篇关于用于API的Kafka命令生成消息,创建使用者组,订阅使用者组并读取记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!