Kafka未捕获的异常

huangapple go评论94阅读模式
英文:

Kafka uncaught exception

问题

在生产者发布第一条消息时,我遇到了以下异常,我正在尝试理解这个错误的含义。

在线程 'kafka-producer-network-thread | producer-1' 中出现未捕获的异常:

java.lang.AbstractMethodError: 方法 brave/kafka/clients/TracingProducer.close(Ljava/time/Duration;)V 是抽象的
	at brave.kafka.clients.TracingProducer.close(TracingProducer.java) ~[brave-instrumentation-kafka-clients-5.6.1.jar:na]
	at org.springframework.kafka.core.KafkaTemplate.closeProducer(KafkaTemplate.java:382) ~[spring-kafka-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.springframework.kafka.core.KafkaTemplate.lambda$buildCallback$4(KafkaTemplate.java:433) ~[spring-kafka-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.apache.kafka.clients.producer.KafkaProducer$InterceptorCallback.onCompletion(KafkaProducer.java:1318) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.ProducerBatch.completeFutureAndFireCallbacks(ProducerBatch.java:227) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.ProducerBatch.done(ProducerBatch.java:196) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:707) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:688) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.handleProduceResponse(Sender.java:596) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.access$100(Sender.java:74) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender$1.onComplete(Sender.java:798) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:109) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:561) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:553) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:335) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:244) ~[kafka-clients-2.3.1.jar:na]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_201]
英文:

I am getting the following exception while the producer is publishing the first message, I am trying to understand what the error means

Uncaught exception in thread 'kafka-producer-network-thread | producer-1':

java.lang.AbstractMethodError: Method brave/kafka/clients/TracingProducer.close(Ljava/time/Duration;)V is abstract
	at brave.kafka.clients.TracingProducer.close(TracingProducer.java) ~[brave-instrumentation-kafka-clients-5.6.1.jar:na]
	at org.springframework.kafka.core.KafkaTemplate.closeProducer(KafkaTemplate.java:382) ~[spring-kafka-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.springframework.kafka.core.KafkaTemplate.lambda$buildCallback$4(KafkaTemplate.java:433) ~[spring-kafka-2.3.6.RELEASE.jar:2.3.6.RELEASE]
	at org.apache.kafka.clients.producer.KafkaProducer$InterceptorCallback.onCompletion(KafkaProducer.java:1318) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.ProducerBatch.completeFutureAndFireCallbacks(ProducerBatch.java:227) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.ProducerBatch.done(ProducerBatch.java:196) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:707) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:688) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.handleProduceResponse(Sender.java:596) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.access$100(Sender.java:74) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender$1.onComplete(Sender.java:798) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:109) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:561) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:553) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:335) ~[kafka-clients-2.3.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:244) ~[kafka-clients-2.3.1.jar:na]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_201]

答案1

得分: 3

Brave 5.6.1太旧了 - 它没有带有Duration参数的Producer.close()方法。看起来这个方法是在5.6.4版本中添加的。

链接:https://github.com/openzipkin/brave/commit/23172461a41bd440ff88cd20a104e621aaa33801#diff-5a863eedbf226b573522c370b4de732a

英文:

Brave 5.6.1 is too old - it doesn't have the Producer.close() method that takes a Duration. It looks like it was added in 5.6.4.

https://github.com/openzipkin/brave/commit/23172461a41bd440ff88cd20a104e621aaa33801#diff-5a863eedbf226b573522c370b4de732a

huangapple
  • 本文由 发表于 2020年8月26日 00:25:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/63583184.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定