![](/img/trans.png)
[英]How to send message to Kafka with Avro serializer and schema registry
[英]Java gradle kafka-avro-serializer and kafka-schema-registry-client fails to download in the deployment pipeline
嘗試在雲中部署我們的服務時,我遇到了兩個傳遞依賴項無法下載並出現錯誤的問題:
Welcome to Gradle 6.7.1!
Here are the highlights of this release:
- File system watching is ready for production use
- Declare the version of Java your build requires
- Java 15 support
For more details see https://docs.gradle.org/6.7.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve io.confluent:kafka-avro-serializer:5.3.2.
Required by:
project :
project : > org.apache.beam:beam-runners-google-cloud-dataflow-java:2.32.0 > org.apache.beam:beam-sdks-java-io-kafka:2.32.0
> Could not resolve io.confluent:kafka-avro-serializer:5.3.2.
> Could not get resource 'http://packages.confluent.io/maven/io/confluent/kafka-avro-serializer/5.3.2/kafka-avro-serializer-5.3.2.pom'.
> Could not GET 'http://packages.confluent.io/maven/io/confluent/kafka-avro-serializer/5.3.2/kafka-avro-serializer-5.3.2.pom'.
> Connection reset
> Could not resolve io.confluent:kafka-schema-registry-client:5.3.2.
Required by:
project :
project : > org.apache.beam:beam-runners-google-cloud-dataflow-java:2.32.0 > org.apache.beam:beam-sdks-java-io-kafka:2.32.0
> Could not resolve io.confluent:kafka-schema-registry-client:5.3.2.
> Could not get resource 'http://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/5.3.2/kafka-schema-registry-client-5.3.2.pom'.
> Could not GET 'http://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/5.3.2/kafka-schema-registry-client-5.3.2.pom'.
> Connection reset
我可以在 web 和 stackoverflow 中找到的大多數分辨率都集中在添加新的 confluent.io gradle 存儲庫:
repositories {
mavenCentral()
maven {
url "http://packages.confluent.io/maven/"
}
}
我嘗試了 http 和 https。 兩者都沒有改變雲中的任何東西。
我嘗試將傳遞依賴項直接添加到項目 gradle。 這種方法也沒有成功:
implementation group: 'io.confluent', name: 'kafka-avro-serializer', version: '5.3.2'
implementation group: 'io.confluent', name: 'kafka-schema-registry-client', version: '5.3.2'
可能是什么問題? 如何最好地解決這個問題?
雲中的防火牆阻止了請求。 由於某種原因,它們沒有被歸類為http
,而是被歸類為confluent
請求,防火牆不知道,因此被阻止。 針對 k8s 中的“融合”應用程序。 我不知道這個應用程序來自哪里,但是......啟用這些請求解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.