在 Apache Kafka 中使用 producer.properties 和 consumer.properties 文件 [英] Use of producer.properties and consumer.properties file in Apache Kafka

查看:89
本文介绍了在 Apache Kafka 中使用 producer.properties 和 consumer.properties 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Kafka 包中有一个 config 文件夹,里面有各种配置文件.这个文件夹有consumer.properties和producer.properties文件,这些配置是在我们运行Kafka集群和我们的代码连接到kafka集群时使用的,还是只是示例属性文件?文档对此不是很清楚.

Inside the Kafka package there is an config folder which has various config files. This folder has consumer.properties and producer.properties files, are these configurations used when we run the Kafka Cluster and when our code connects to kafka cluster or are these just sample property files? The documentation is not very clear on this.

我们有一个自动化作业来创建和部署新的 kafka 节点,我需要知道是否需要对这些文件进行任何更改.

We have an automation job that create and deploys new kafka nodes and I need to know whether any changes needs to be made in these files.

推荐答案

consumer.properties 和 producer.properties 文件只是配置使用者或生产者应用程序的示例.它们可以被 kafka-console-consumer 控制台应用程序使用,例如通过 kafka-console-producer 使用 --consumer.config 参数> 带有 --producer.config 参数的控制台应用程序.在任何情况下,即使是 server.properties 和 zookeeper.properties 文件也是 broker 和 zookeeper 的配置示例.

The consumer.properties and producer.properties files are just examples for configuring a consumer or producer application. They can be used by the kafka-console-consumer console application for example with the --consumer.config paramenter by the kafka-console-producer console application with the --producer.config parameter. In any case even server.properties and zookeeper.properties files are example of configuration for broker and zookeeper.

这篇关于在 Apache Kafka 中使用 producer.properties 和 consumer.properties 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆