将 csvReader 配置为使用 Apache Nifi 中的 Avro 架构注册表时遇到错误

问题描述

csvReader 属性集: enter image description here

这是我在 AvroSchemaRegistry 中创建和注册的架构

{ "命名空间": "nifi","类型": "记录","name": "用户",“领域”:[ {"name": "first_name","type": "string"},{"name": "last_name",{"name": "age","type": "int"} ] }

我在运行 apache-nifi 处理器时遇到的错误

org.apache.nifi.schema.access.SchemaNotFoundException: FlowFile did not contain appropriate attributes to determine Schema Text

解决方法

将您的 CSVReader 配置为 -

Schema Access Strategy = Use 'Schema Name' Property

Schema Registry = Your AvroSchemaRegistry Controller Service

Schema Name = users

Schema Text = let it be default value

这意味着 CSVReader 将在模式注册表中搜索指定的模式名称,因为访问策略是模式名称,我们将其传递给注册表。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...