在Event Hub的门户页面中,可以通过Process Data页面查看Event Hub中的数据,但是当使用JSON格式预览时(View in JSON),却出现错误。
消息一: No data was found for preview from 'test01'. Make sure the input has recently received data and the correct format of those events has been selected. [SessionID: 6b15d63464bf41f9b6e6c758f58a26ef
消息二:Source '' had 1 occurrences of kind 'InputDeserializerError.InvalidData' between processing times '2023-07-24T06:24:42.5057556Z' and '2023-07-24T06:24:42.5057556Z'. Could not deserialize the input event(s) from resource 'Partition: [0], Offset: [0], SequenceNumber: [0]' as Json. Some possible reasons: 1) Malformed events 2) Input source configured with incorrect serialization format
在错误消息二中,出现了“ Input source configured with incorrect serialization format ”指明了数据解析为JSON过程中出现了不正确的序列化格式。这里就很明确的说明了无数据显示的原因是数据格式错误引起。 为了进一步调查这个问题,就需要通过其他方式获取出消息的内容,然后检查为什么它不是一个正确的JSON格式。
方式一:在Process Data页面中,选择 View by CSV - comma(,) 可以看见内容,但是发现格式很不一致,无法准确判断。
但是从测试的结果证明: Event Hub Process Data页面不识别大小写。所以在进行格式转换的时候抛出了 “InputDeserializerError.InvalidData : Input source configured with incorrect serialization format ”