nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Burgess <>
Subject Re: How to read a schema from a ScriptedReader
Date Wed, 08 Apr 2020 20:18:56 GMT

It is possible for a ScriptedReader to use a SchemaRegistry, although
it isn't currently as easy as it could be. When the Scripted
Reader/Writer components were added [1], much of the reusable code for
schema registry processing was in the service implementation NAR, so
the aforementioned Jira explains that using the SchemaRegistry
interface is certainly possible in ScriptedReader but fairly
cumbersome.  Since then the SchemaRegistryService and associated util
classes were moved to a nifi-avro-record-utils [2] so
extensions/components can leverage schema registries. Unfortunately
nifi-avro-record-utils is not currently included in the scripting NAR,
but I have written up [3] to add this.

In the meantime, take a look at SchemaRegistryService,
SchemaAccessUtils, and an implementation class such as AvroReader, you
could copy and paste all the necessary code to get your ScriptedReader
to interact with a schema registry.



On Wed, Apr 8, 2020 at 2:01 PM Jairo Henao <> wrote:
> Hi all,
> Is there a way from a ScriptedReader (Controller Service) to read a schema that is stored
in an AvroSchemaRegistry?
> I am using Groovy as a language.
> Additionally, how can I read additional properties that I have added to my ControllerService
from Groovy code.
> Thanks in advance
> --
> Saludos
> Jairo Henao

View raw message