首页 > 其他分享 >Kafka学习笔记(九):CLI Consumer in Groups & Consumer Groups

Kafka学习笔记(九):CLI Consumer in Groups & Consumer Groups

时间:2023-01-08 16:23:16浏览次数:42  
标签:group CLI -- Consumer kafka sh Groups console consumer

CLI Consumer in Groups with kafka-console-consumer.sh

# Replace "kafka-console-consumer.sh" 
# by "kafka-console-consumer" or "kafka-console-consumer.bat" based on your system # (or bin/kafka-console-consumer.sh or bin\windows\kafka-console-consumer.bat if you didn't setup PATH / Environment variables)

# start one consumer
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic first_topic --group my-first-application

# start one producer and start producing
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic first_topic

# start another consumer part of the same group. See messages being spread
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic first_topic --group my-first-application

# start another consumer part of a different group from beginning
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic first_topic --group my-second-application --from-beginning

Consumer Group Management CLI kafka-consumer-groups.sh

 # Replace "kafka-consumer-groups.sh" 
# by "kafka-consumer-groups" or "kafka-consumer-groups.bat" based on your system # (or bin/kafka-consumer-groups.sh or bin\windows\kafka-consumer-groups.bat if you didn't setup PATH / Environment variables)

# documentation for the command 
kafka-consumer-groups.sh 

# list consumer groups
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
 
# describe one specific group
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-second-application

# describe another group
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-first-application

# start a consumer
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic first_topic --group my-first-application

# describe the group now
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-first-application

# describe a console consumer group (change the end number)
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group console-consumer-10592

# start a console consumer
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic first_topic --group my-first-application

# describe the group again
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-first-application

标签:group,CLI,--,Consumer,kafka,sh,Groups,console,consumer
From: https://www.cnblogs.com/Bota5ky/p/17034808.html

相关文章

  • Kafka学习笔记(八):Kafka CLI
    KafkaCLI:kafka-topics.sh#Replace"kafka-topics.sh"#by"kafka-topics"or"kafka-topics.bat"basedonyoursystem#(orbin/kafka-topics.shorbin\windows......
  • vue-cli更改包管理器yarn为npm
    找到路径C:\Users{当前登录的用户名}\下的.vuerc文件打开此文件,修改packageManager的值就可以了如果你想在项目中使用npm包管理工具,就将其值改为"npm"如果你想在项目中......
  • 项目工程化--添加CLI
    使用命令启动服务例如初始化vblog-apiinit启动服务vblog-apistart-fetc/confit.toml版本号vblog-api-v需要借助一个强大的CLI库Cobrahttps://github.com......
  • mysql 连接时报错 :Client does not support authentication protocol requested by se
      错误原因:登录mysql 查看登录的用户的加密方式:  目前用的时最新版的mysql8 用户信息加密方式用的是caching_sha2_password实现的,  将其改为mysql......
  • 大数据 - ClickHouse
    ​​https://clickhouse.com/​​概念ClickHouse是俄罗斯的Yandex于2016年开源的列式存储数据库(DBMS),使用C++语言编写,主要用于在线分析处理查询(OLAP),能够使用SQL查询......
  • dart HttpSocket&HttpClient
    HttpSocketvarserver=awaitHttpServer.bind(InternetAddress.loopbackIPv4,4040,);print('Listeningonlocalhost:${server.port}');awaitfor(HttpReq......
  • ClickHouse入门
    ClickHouse入门版本21.7.3.14ClickHouse是列式存储数据库(DBMS),主要用于在线分析处理查询(OLAP)。ClickHouse对函数是大小写敏感的,不管是什么操作,还是区分大小写好点官......
  • clickhouse-local
    clickhouse-local可以使你能够对本地文件执行快速处理,而无需部署和配置ClickHouseServer。可以理解成是ClickHouse服务的单机版微内核,是一个轻量级的应用程序clickhouse-......
  • .net core HttpClient 使用之掉坑解析(一)
    一、前言在我们开发当中经常需要向特定URL地址发送Http请求操作,在.netcore中对httpClient使用不当会造成灾难性的问题,这篇文章主要来分享.netcore中通过IHttpClientFac......
  • uni-app HBuilderX 工程转换 vue-cli 工程
    1、使用vue-cli4新建空工程vuecreate-pdcloudio/uni-preset-vuemy-project地址不行就直接下载,使用本地地址2、将HBuilderX工程内的文件(除unpackage、node......