首页 > 其他分享 >【Azure 事件中心】Kafka 生产者发送消息失败的分析步骤

【Azure 事件中心】Kafka 生产者发送消息失败的分析步骤

时间:2023-06-26 20:55:07浏览次数:43  
标签:java Sender producer 步骤 kafka apache Azure org Kafka

问题描述

Azure Event Hubs -- Kafka 生产者发送消息存在延迟接收和丢失问题, 在客户端的日志中发现如下异常:

2023-06-05 02:00:20.467 [kafka-producer-thread | producer-1] ERROR com.deloitte.common.kafka.CommonKafkaProducer - messageId:9235f334-e39f-b429-227e-45cd30dd6486, topic:notify_topic
发送消息失败 org.springframework.kafka.core.KafkaProducerException: Failed to send; nested exception is org.apache.kafka.common.errors.TimeoutException: The request timed out.
at org.springframework.kafka.core.KafkaTemplate.lambda$buildCallback$6(KafkaTemplate.java:690) 
at org.apache.skywalking.apm.plugin.kafka.CallbackAdapter.onCompletion(CallbackAdapter.java:45) 
at org.springframework.kafka.core.DefaultKafkaProducerFactory$CloseSafeProducer$1.onCompletion$original$dElInXX8(DefaultKafkaProducerFactory.java:1001) 
at org.springframework.kafka.core.DefaultKafkaProducerFactory$CloseSafeProducer$1.onCompletion$original$dElInXX8$accessor$6jLL1TNr(DefaultKafkaProducerFactory.java) 
at org.springframework.kafka.core.DefaultKafkaProducerFactory$CloseSafeProducer$1$auxiliary$ldSQQGBZ.call(Unknown Source) 
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86) 
at org.springframework.kafka.core.DefaultKafkaProducerFactory$CloseSafeProducer$1.onCompletion(DefaultKafkaProducerFactory.java) 
at org.apache.kafka.clients.producer.KafkaProducer$InterceptorCallback.onCompletion$original$PwZecSoL(KafkaProducer.java:1350) 
at org.apache.kafka.clients.producer.KafkaProducer$InterceptorCallback.onCompletion$original$PwZecSoL$accessor$5Ux1udg0(KafkaProducer.java) 
at org.apache.kafka.clients.producer.KafkaProducer$InterceptorCallback$auxiliary$a5oVYNi3.call(Unknown Source) 
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:86) 
at org.apache.kafka.clients.producer.KafkaProducer$InterceptorCallback.onCompletion(KafkaProducer.java) 
at org.apache.kafka.clients.producer.internals.ProducerBatch.completeFutureAndFireCallbacks(ProducerBatch.java:273) 
at org.apache.kafka.clients.producer.internals.ProducerBatch.done(ProducerBatch.java:234) 
at org.apache.kafka.clients.producer.internals.ProducerBatch.completeExceptionally(ProducerBatch.java:198) 
at org.apache.kafka.clients.producer.internals.Sender.failBatch(Sender.java:758) 
at org.apache.kafka.clients.producer.internals.Sender.failBatch(Sender.java:743) 
at org.apache.kafka.clients.producer.internals.Sender.failBatch(Sender.java:695) 
at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:634) 
at org.apache.kafka.clients.producer.internals.Sender.lambda$null$1(Sender.java:575) 
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) 
at org.apache.kafka.clients.producer.internals.Sender.lambda$handleProduceResponse$2(Sender.java:562) 
at java.base/java.lang.Iterable.forEach(Iterable.java:75) 
at org.apache.kafka.clients.producer.internals.Sender.handleProduceResponse(Sender.java:562) 
at org.apache.kafka.clients.producer.internals.Sender.lambda$sendProduceRequest$5(Sender.java:836) 
at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:109) 
at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:574) 
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:566) 
at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:328) 
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:243) 
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.apache.kafka.common.errors.TimeoutException: The request timed out.

 

当发送端收到 Failed to send; nested exception is org.apache.kafka.common.errors.TimeoutException: The request timed out. 日志后, 如何来分析这个问题呢?

问题回答

机器人回答一:

This error message indicates that the Kafka producer failed to send a message due to a timeout.

One possible reason for this error is that the transaction timeout is larger than the maximum value allowed by the broker.

You can check the broker configuration for `transaction.max.timeout.ms` and make sure that it is set to a value that is larger than the transaction timeout used by the producer.

You can also check the Kafka logs for more information about the error.

If you are using Flink, you can refer to the Hilo documentation on [Flink to HDInsightKafkaTransactionTimeoutIssue](https://supportability.visualstudio.com/870b0c89-5235-4a33-a0c6-44be26e284e7/_wiki/wikis/e9f84cb2-cd1b-4143-ac21-5bc63f3bdba0?pagePath=%2FHilo%2F[Hilo] TSGs%2F[Hilo] Flink TSGs%2F[Hilo] Flink to HDInsightKafkaTransactionTimeoutIssue) for more information on this issue. One or more links in the message.

 

机器人回答二:

The error message you provided indicates that the request timed out. This could be due to a network issue or a configuration issue. You can check the following: 1. Check the network connection between the producer and the Event Hub service. Make sure that the network is stable and that there are no issues with the firewall or network security groups. 2. Check the Kafka producer configuration. Make sure that the `request.timeout.ms` property is set to a value that is appropriate for your use case. You can also try increasing the value of this property to see if it resolves the issue. 3. Check the size of the message being sent. If the message size is greater than the maximum allowed size, the request may time out. You can check the maximum message size allowed by the Event Hub service and make sure that your message size is within the limit. 4. Check the Kafka logs for more information about the error. The logs may provide more details about the cause of the error. If you are still unable to resolve the issue, you can contact Azure support for further assistance. Message is interactive. Click to interact.


If you are not using Flink and are using the Kafka producer method to send messages to Event Hub, you can check the Kafka logs for more information about the error.

The error message you provided indicates that the request timed out. This could be due to a network issue or a configuration issue. You can check the following:

1. Check the network connection between the producer and the Event Hub service. Make sure that the network is stable and that there are no issues with the firewall or network security groups.

2. Check the Kafka producer configuration. Make sure that the `request.timeout.ms` property is set to a value that is appropriate for your use case. You can also try increasing the value of this property to see if it resolves the issue.

3. Check the size of the message being sent. If the message size is greater than the maximum allowed size, the request may time out. You can check the maximum message size allowed by the Event Hub service and make sure that your message size is within the limit.

4. Check the Kafka logs for more information about the error. The logs may provide more details about the cause of the error.

If you are still unable to resolve the issue, you can contact Azure support for further assistance.

 

标签:java,Sender,producer,步骤,kafka,apache,Azure,org,Kafka
From: https://www.cnblogs.com/lulight/p/17506691.html

相关文章

  • 何时使用Kafka而不是RabbitMQ
    Kafka和RabbitMQ都是流行的开源消息系统,它们可以在分布式系统中实现数据的可靠传输和处理。Kafka和RabbitMQ有各自的优势和特点,它们适用于不同的场景和需求。本文将比较Kafka和RabbitMQ的主要区别,并分析何时使用Kafka而不是RabbitMQ。影响因素可扩展性:Kafka旨在......
  • 标准化互信息NMI计算步骤及其Python实现
    假设对于17个样本点(v1,v2,...,v17)进行聚类:某一种算法得到聚类结果为:A=[12111112222311333]标准的聚类结果为:B=[11111122222233333]问题:需要度量算法结果与标准结果之间的相似度,如果结果越相似NMI值应接近1;如果算法结果很差......
  • 广州电商网站建设有哪些步骤?打造高效盈利商城
    在如今的数字时代,电商网站已经成为许多企业获得更多客户和利润的渠道。然而,对于大多数企业而言,如何打造一个高效盈利的广州电商网站是他们正面临的问题。那么,广州电商网站建设有哪些步骤?接下来,广州名锐讯动MRT将带大家一起探讨其关键步骤。第一步:市场调研与网站目标定位首先在广州......
  • ceph 部署步骤和原理理解
    1.ceph的官方源在国外,网速比较慢,此处添加ceph源为阿里源(每个节点上均执行)vim/etc/yum.repos.d/ceph.repo[Ceph]name=Cephpackagesfor$basearchbaseurl=https://mirrors.aliyun.com/ceph/rpm-luminous/el7/x86_64/enabled=1gpgcheck=1type=rpm-mdgpgkey=https://downlo......
  • linux-kafka
    kafka一、单点部署docker-compose创建参考地址https://gitee.com/jasonyin2020/docker-compose/tree/master1.下载kafka软件包[[email protected]~]#ll-rw-r--r--1rootroot103956099Apr1016:09kafka_2.13-3.2.1.tgz2.解压软件包[[email protected]~]#tarxf......
  • 【Azure 媒体服务】Azure Media Player 在Edge浏览器中不能播放视频问题的分析与解决
    问题描述使用AzureMediaService制作视频点播服务,在客户端使用AzureMediaPlayer播放器在Edge浏览器中播放视频时候遇见无法播放的问题:错误信息:Thevideoplaybackwasabortedduetoacorruptionproblemorbecausethevideousedfeaturesyourbrowserdidnotsuppo......
  • 【Azure 媒体服务】Azure Media Player 在Edge浏览器中不能播放视频问题的分析与解决
    问题描述使用AzureMediaService制作视频点播服务,在客户端使用AzureMediaPlayer播放器在Edge浏览器中播放视频时候遇见无法播放的问题:错误信息:Thevideoplaybackwasabortedduetoacorruptionproblemorbecausethevideousedfeaturesyourbrowserdidnot......
  • 【教程】解决SVN冲突-详细步骤-已实现
    遇到svn冲突如何解决?本地的和线上的如何编辑?如何解决冲突?请看实践教程:svn冲突。解决方法:一、先更新最新代码:1、在<本地代码>项目文件夹中右击---TortoiseSVN-->Merge...-->Next-->URLtomergefrom(选择主分支路径http://xxxxx/xxx/xx/xxxxx_OA)-->Next-->Testmerge看......
  • Linux VM通过NFS3.0挂载Azure Blob Storage Container后访问共享文件夹Permission den
    问题描述如图所示,/root-squash是一个BlobStorageContainer的挂载点。ls-al查看该目录的权限为:drwxr-xr--2rootroot0Jun2323:15root-squash当前用户身份为root,但在尝试进入该目录时失败,报错信息为:-bash:cd:root-squash:Permissiondenied调查过程猜......
  • kafka集群搭建
    https://blog.csdn.net/wudidahuanggua/article/details/1270861861安装准备请确保zookeeper集群的正常启动可参考:大数据学前准备--zookeeper详解与集群搭建(保姆级教程) 2下载kafkaApacheKafka上传kafka至node001节点 3安装3.1解压tar-zxvfkafka......