You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何禁用Esper的avro.EventTypeAvroHandlerFactory警告?

解决Esper Avro相关重复警告的方法

方案一:通过日志配置屏蔽指定类的警告

该警告来自com.espertech.esper.common.internal.event.avro.EventTypeAvroHandlerFactory类,直接在项目的日志配置文件中把这个类的日志级别设为OFF或ERROR即可屏蔽警告:

Logback配置示例

<logger name="com.espertech.esper.common.internal.event.avro.EventTypeAvroHandlerFactory" level="OFF"/>

Log4j2配置示例

<Logger name="com.espertech.esper.common.internal.event.avro.EventTypeAvroHandlerFactory" level="OFF" additivity="false"/>

方案二:通过Esper配置明确禁用Avro支持

在初始化Esper时,通过Configuration对象直接关闭Avro支持,从根源避免该警告触发:

Configuration configuration = new Configuration();
// 禁用Avro事件类型支持
configuration.getCommon().getEventMeta().getAvro().setEnabled(false);
// 只需要获取一次Runtime,避免重复初始化
EPRuntime runtime = EPRuntimeProvider.getDefaultRuntime(configuration);
EPEventService eventService = runtime.getEventService();

内容的提问来源于stack exchange,提问作者Dakotah North

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 11:20:31