簡體   English   中英

如何使用kafka connect和XML配置文件配置測試環境

[英]How to configure test environment using kafka connect and XML config file

我是 kafka 的新手,我寫了一段代碼,寫了一個主題(制作人)。

現在,我的任務是查看內容是否針對該主題編寫。

我的技術主管提供的唯一信息是我應該安裝 kafka connect,並使用這個 XML:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<connections>
<connection bootstrap_servers="xxxxxxxxxx.c3.kafka.eu-west-3.amazonaws.com:9096,xxxxxxxxxx.c3.kafka.eu-west-3.amazonaws.com:9096,xxxxxxxxxx.c3.kafka.eu-west-3.amazonaws.com:9096" broker_security_type="SASL_SSL" chroot="/" group="Clusters" groupId="1" host="xxxxxxxxxx.c3.kafka.eu-west-3.amazonaws.com" jaas_config="org.apache.kafka.common.security.scram.ScramLoginModule required username=&quot;USER&quot; password=&quot;PASSWD&quot;;" keystore_location="" keystore_password="" keystore_privatekey="" name="Worten" port="9096" sasl_mechanism="SCRAM-SHA-512" schema_registry_endpoint="" truststore_location="" truststore_password="" version="VERSION_2_7_0"/>
<groups>
<group id="1" name="Clusters"/>
</groups>
</connections>

我完全不知道在哪里或如何導入這個 xml 配置文件。 我安裝了 kafka,讓它在本地運行,但所有配置文件通常都是這種格式:

$ cat config/connect-standalone.properties

部分 output:

bootstrap.servers=xxxxxxxxx.c3.kafka.eu-west-3.amazonaws.com:9096,xxxxxxxxx.c3.kafka.eu-west-3.amazonaws.com:9096,xxxxxxxxx.c3.kafka.eu-west-3.amazonaws.com:9096

# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will
# need to configure these based on the format they want their data in when loaded from or stored into Kafka
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply
# it to
key.converter.schemas.enable=true
value.converter.schemas.enable=true

offset.storage.file.filename=/tmp/connect.offsets
# Flush much faster than normal, which is useful for testing/debugging
offset.flush.interval.ms=10000

我嘗試在此處添加字段,但缺少很多字段,非常歡迎任何提示,我做了一些研究,但找不到對我有幫助的東西。

謝謝!!!

我嘗試搜索任何可以讓我啟動本地獨立消費者集群的東西,這樣我就可以看到我正在寫的主題。

Kafka Connect 不使用 XML 個文件。 它僅使用 Java .properties文件。

您顯示的屬性文件缺少SASL_SSL中提到的 SASL_SSL 值。

Kafka 快速入門涵蓋了運行 Kafka Connect 獨立模式,您可以參考配置屬性的文檔,例如consumer. producer. 需要使用 SASL/SSL 值配置的屬性,例如consumer.sasl.mechanism=SCRAM-SHA-512

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM