无法仅在一个消费微服务上进行 AVRO 序列化
Failing to AVRO serialise on only one consuming microservice
我有五个 Kafka 消费服务和一个 Kafka 生产服务。我在每个 Java 消费微服务的消费者库中推出了一个新的 avro 模式。我还没有对制作方进行更改。但是其中一项消费服务无法序列化其他四个工作正常的任何内容。
我得到这个异常
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
at javax.ws.rs.core.UriBuilder.fromPath(UriBuilder.java:111)
at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:656)
at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:642)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaByIdFromRegistry(CachedSchemaRegistryClient.java:217)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaBySubjectAndId(CachedSchemaRegistryClient.java:291)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaById(CachedSchemaRegistryClient.java:276)
at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer$DeserializationContext.schemaFromRegistry(AbstractKafkaAvroDeserializer.java:273)
at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserialize(AbstractKafkaAvroDeserializer.java:97)
at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserialize(AbstractKafkaAvroDeserializer.java:87)
at io.confluent.kafka.serializers.KafkaAvroDeserializer.deserialize(KafkaAvroDeserializer.java:62)
一些在生产者端和消费者端都发生变化的是
kafka-avro-serializer 高达 6.0.0
kafka-clients 最高 2.0.0
结果到达这个消费者的记录是空的,在我们的配置中阻塞了我们的队列,我们不推进手动偏移量。
希望能帮到你。
您需要包含 jersey-client
库。
您可以手动或根据您的构建工具添加 .jar
:
Maven
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.0.0</version>
</dependency>
Gradle
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '3.0.0'
SBT
libraryDependencies += "org.glassfish.jersey.core" % "jersey-client" % "3.0.0"
...
(...)
我有五个 Kafka 消费服务和一个 Kafka 生产服务。我在每个 Java 消费微服务的消费者库中推出了一个新的 avro 模式。我还没有对制作方进行更改。但是其中一项消费服务无法序列化其他四个工作正常的任何内容。
我得到这个异常
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
at javax.ws.rs.core.UriBuilder.fromPath(UriBuilder.java:111)
at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:656)
at io.confluent.kafka.schemaregistry.client.rest.RestService.getId(RestService.java:642)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaByIdFromRegistry(CachedSchemaRegistryClient.java:217)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaBySubjectAndId(CachedSchemaRegistryClient.java:291)
at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.getSchemaById(CachedSchemaRegistryClient.java:276)
at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer$DeserializationContext.schemaFromRegistry(AbstractKafkaAvroDeserializer.java:273)
at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserialize(AbstractKafkaAvroDeserializer.java:97)
at io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer.deserialize(AbstractKafkaAvroDeserializer.java:87)
at io.confluent.kafka.serializers.KafkaAvroDeserializer.deserialize(KafkaAvroDeserializer.java:62)
一些在生产者端和消费者端都发生变化的是
kafka-avro-serializer 高达 6.0.0
kafka-clients 最高 2.0.0
结果到达这个消费者的记录是空的,在我们的配置中阻塞了我们的队列,我们不推进手动偏移量。
希望能帮到你。
您需要包含 jersey-client
库。
您可以手动或根据您的构建工具添加 .jar
:
Maven
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.0.0</version>
</dependency>
Gradle
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '3.0.0'
SBT
libraryDependencies += "org.glassfish.jersey.core" % "jersey-client" % "3.0.0"
...
(...)