【Azure 事件中心】EventHub 中同一条消息不停的推送给消费端问题记录

问题描述

EventHub 中同一条消息,不停的推送给消费端,查看日志发现错误:

复制代码
Caused by: com.azure.messaging.eventhubs.implementation.PartitionProcessorException: Error in event processing callback
                at com.azure.messaging.eventhubs.PartitionPumpManager.processEvent(PartitionPumpManager.java:280)
                at com.azure.messaging.eventhubs.PartitionPumpManager.processEvents(PartitionPumpManager.java:314)
                ... 12 common frames omitted
Caused by: org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: org.postgresql.util.PSQLException: ERROR: column "messageeventcode" does not exist
  Hint: Perhaps you meant to reference the column "event_code".
  Position: 2209
### The error may exist in file [D:\home\site\wwwroot\webapps\xxxxxx.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
复制代码

问题分析

在客户端的日志中,发现消费端每一分钟都会与处理器(process event )建立,而消费端连接后,都会通过Storage Account上存储的检查点(Checkpoint)来开始消费消息,而发现检查点一直都是同一个位置Starting event processing from offset[xxxx244317],随后就出现了 Exception: Error in event processing callback 异常,导致消费端的这个进程关闭: Closing partition processor for partition 1 with close reason LOST_PARTITION_OWNERSHIP。

这个错误由接收事件时的错误或on_event中的错误引起,关闭了处理器连接,之后重新建立的连接还是从Starting event processing from offset[xxxx244317]开始的,所以导致一直消费相同的数据。只要解决了 PARTITION_PROCESSOR 事件中所引发异常的代码后,就可以解决此问题。

 

 

 

 

参考资料

Event Hub CheckPoint: https://docs.azure.cn/zh-cn/event-hubs/event-hubs-features#checkpointing

 

posted @   路边两盏灯  阅读(200)  评论(1编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-01-31 【Azure 应用服务】Azure App Service (Windows) 使用Flask框架部署Python应用,如何在代码中访问静态文件呢?如何设置文件路径?是相对路径还是绝对路径呢?
点击右上角即可分享
微信分享提示