Spring-Cloud-Stream Kafka Azure-提取数据时出现意外错误代码13 [英] Spring-Cloud-Stream Kafka Azure - Unexpected error code 13 while fetching data

查看:76
本文介绍了Spring-Cloud-Stream Kafka Azure-提取数据时出现意外错误代码13的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发docker化的SpringBoot应用。
泊坞窗映像是微服务,其中一个与Azure Event Hub通信。

I'm developing a SpringBoot app dockerized. The docker images are microservices and one of these communicate with Azure Event Hub.

我的一些属性:


spring-boot-> 2.0.7。发行

spring-cloud.version-> Finchley.SR2

spring-cloud.version -> Finchley.SR2

我已经在Azure中创建了一个主题(启用了 Kafka )。

I've created a topic in Azure(with Kafka enabled).

我遵循一些简单的指南来设置我的微服务,一切正常。

I've follow some simple guide to set up my microservice and everything works fine.

@EnableBinding({Processor.class})
public class EventService {
    ...
    @Autowired private Processor ehProcessor;
    ...
    public void send(String event) {

        Message<String> message = MessageBuilder
                .withPayload(event)
                .setHeader(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.APPLICATION_JSON)
                .build();

        boolean send = ehProcessor.output().send(message, 5000L);

        if (!send) {

            log.error("Event NOT sent", event);
        }
    }

    ...

    @StreamListener(target = Processor.INPUT)
    public void receive(String event) {

        handle(event);
    }
}

整个月一切都很好,但最近两天微服务卡住,因为连续的堆栈跟踪填充了我的所有磁盘(解决方案是设置docker日志循环)。

For an entire month everything goes fine but in the last two days the microservice stucks because a continuous stacktrace is filling all my disc (a solution was to set up a docker log rotation).

java.lang.IllegalStateException: Unexpected error code 13 while fetching data
        at org.apache.kafka.clients.consumer.internals.Fetcher.parseCompletedFetch(Fetcher.java:891) ~[kafka-clients-1.0.1.jar!/:na]
        at org.apache.kafka.clients.consumer.internals.Fetcher.fetchedRecords(Fetcher.java:528) ~[kafka-clients-1.0.1.jar!/:na]
        at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:1154) ~[kafka-clients-1.0.1.jar!/:na]
        at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1111) ~[kafka-clients-1.0.1.jar!/:na]
        at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.run(KafkaMessageListenerContainer.java:699) ~[spring-kafka-2.1.7.RELEASE.jar!/:2.1.7.RELEASE]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_181]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_181]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]

我说的是1毫秒内的8/9日志消息。

I'm talking about 8/9 log messsage in 1 ms.

查看 org.apache.kafka.common.protocol.Errors
中的错误与以下内容有关:

Looking inside the org.apache.kafka.common.protocol.Errors class the error is related to:


NETWORK_EXCEPTION(13,服务器在收到响应
之前已断开连接。

NETWORK_EXCEPTION(13, "The server disconnected before a response was received."

我无法以编程方式重现此错误。
我不明白为什么在出现第一个错误时,日志将开始并且在无限循环中没有停止。我需要停止docker容器,有时容器不会停止。
唯一的解决方案是删除容器并重新创建。

I'm not able to reproduce programmatically this error. I don't understand why when the first error is arised the log will start and no stop in infinite loop. I need to stop the docker container and sometimes the container will not stop. The only solution is to remove the container and recreate again.

更新

我已经打开github 此处上的一个问题。我已经收到了答复,他们开始对此进行调查。

I've open an issue on github here. I've already received a response and they are starting to investigate on it.

更新

问题已经出在


当他们将UnknownServerException更改为NetworkException时,
Spring Boot开始陷入重试循环。

When they changed an UnknownServerException to a NetworkException, Spring Boot started getting stuck in the retry loop.


推荐答案

它已在 link

最近发生了更改,将UnknownServerException的实例更改为NetworkException。

There was a recent change where an instance of UnknownServerException was changed to a NetworkException.

问题详细信息在这里- https://github.com/Azure/azure-event-hubs-for-kafka/issues -带有您的命名空间信息。谢谢!

Issue details are here - https://github.com/Azure/azure-event-hubs-for-kafka/issues - with your namespace info. Thanks!

这篇关于Spring-Cloud-Stream Kafka Azure-提取数据时出现意外错误代码13的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆