kafka消费者命令行的使用方法

本文深入探讨了如何利用Kafka Console Consumer进行消息消费,特别关注于多消费者环境下的配置技巧与实践应用。通过提供详细的参数说明与实例,帮助开发者高效地管理Kafka集群资源。
摘要由CSDN通过智能技术生成

root@ocdata07 bin]# ./kafka-console-consumer.sh
The console consumer is a tool that reads data from Kafka and outputs it to standard output.
Option                                  Description                            
------                                  -----------                            
--blacklist <blacklist>                 Blacklist of topics to exclude from    
                                          consumption.                         
--consumer.config <config file>         Consumer config properties file.       
--csv-reporter-enabled                  If set, the CSV metrics reporter will  
                                          be enabled                           
--delete-consumer-offsets               If specified, the consumer path in     
                                          zookeeper is deleted when starting up
--formatter <class>                     The name of a class to use for         
                                          formatting kafka messages for        
                                          display. (default: kafka.tools.      
                                          DefaultMessageFormatter)             
--from-beginning                        If the consumer does not already have  
                                          an established offset to consume     
                                          from, start with the earliest        
                                          message present in the log rather    
                                          than the latest message.             
--max-messages <Integer: num_messages>  The maximum number of messages to      
                                          consume before exiting. If not set,  
                                          consumption is continual.            
--metrics-dir <metrics dictory>         If csv-reporter-enable is set, and     
                                          this parameter isset, the csv        
                                          metrics will be outputed here        
--property <prop>                                                              
--skip-message-on-error                 If there is an error when processing a
                                          message, skip it instead of halt.    
--topic <topic>                         The topic id to consume on.            
--whitelist <whitelist>                 Whitelist of topics to include for     
                                          consumption.                         
--zookeeper <urls>                      REQUIRED: The connection string for    
                                          the zookeeper connection in the form
                                          host:port. Multiple URLS can be      
                                          given to allow fail-over.     


因此要同时启动 多个不同组的消费者,要么指定不同的配置文件,要么设置不同的property

不过设置consumer.config 的试过了 --可以用

但是property的只是在java api中用过 因此我感觉这里也可以用(猜想)   

转载于:https://my.oschina.net/u/2329222/blog/479463

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值