使用 kafka 实现架构注册表时出错

我正在尝试使用spring-kata使用记录,但在服务器启动期间遇到以下异常。生产者通过与 mysql 的融合独立使用 cdc。我能够从独立的消费者那里正确消费它,但通过spring-kafka消费对我来说似乎是一个问题。


Caused by: java.lang.NoClassDefFoundError: io/confluent/common/config/ConfigException

    at java.lang.Class.forName0(Native Method) ~[na:1.8.0_131]

    at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_131]

    at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:709) ~[kafka-clients-2.1.1.jar:na]

    at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:471) ~[kafka-clients-2.1.1.jar:na]

    at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:464) ~[kafka-clients-2.1.1.jar:na]

    at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:62) ~[kafka-clients-2.1.1.jar:na]

    at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:75) ~[kafka-clients-2.1.1.jar:na]

    at org.apache.kafka.clients.consumer.ConsumerConfig.<init>(ConsumerConfig.java:511) ~[kafka-clients-2.1.1.jar:na]

    at org.apache.kafka.clients.consumer.KafkaConsumer.<init>(KafkaConsumer.java:617) ~[kafka-clients-2.1.1.jar:na]

    at org.springframework.kafka.core.DefaultKafkaConsumerFactory.createKafkaConsumer(DefaultKafkaConsumerFactory.java:139) ~[spring-kafka-2.1.8.RELEASE.jar:2.1.8.RELEASE]

    at org.springframework.kafka.core.DefaultKafkaConsumerFactory.createKafkaConsumer(DefaultKafkaConsumerFactory.java:134) ~[spring-kafka-2.1.8.RELEASE.jar:2.1.8.RELEASE]

    at org.springframework.kafka.core.DefaultKafkaConsumerFactory.createConsumer(DefaultKafkaConsumerFactory.java:102) ~[spring-kafka-2.1.8.RELEASE.jar:2.1.8.RELEASE]

    at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.<init>(KafkaMessageListenerContainer.java:425) ~[spring-kafka-2.1.8.RELEASE.jar:2.1.8.RELEASE]


喵喵时光机
浏览 139回答 1
1回答

肥皂起泡泡

您可以使用此依赖项获取该类<dependency>&nbsp; &nbsp; <groupId>io.confluent</groupId>&nbsp; &nbsp; <artifactId>common-config</artifactId>&nbsp; &nbsp; <version>5.1.0</version></dependency>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java