nifi-users mailing list archives

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

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.

Regards,
Matt

[1] https://issues.apache.org/jira/browse/NIFI-3734
[2] https://issues.apache.org/jira/browse/NIFI-5123
[3] https://issues.apache.org/jira/browse/NIFI-7343

On Wed, Apr 8, 2020 at 2:01 PM Jairo Henao <jairohenaorojas@gmail.com> 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

Mime
View raw message