Thanks Matt, I have made some changes using AvroReader as an example, but I am still able to access other ControllerServices.
>From the RecordReaderFactory I have access to a context that is of type *org.apache.nifi.controller.service.StandardConfigurationContext* but with this I don't know how to access the AvroSchemaRegistry. Do you know how I can access the ControllerServiceLookup? On Wed, Apr 8, 2020 at 3:19 PM Matt Burgess <mattyb...@apache.org> wrote: > 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 <jairohenaoro...@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 > -- Saludos Jairo Henao *Chat Skype: jairo.henao.05*