Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Not sure why schema registry is not working

Highlighted

Not sure why schema registry is not working

New Contributor

I'm integrating Hortonworks schema registry with NIFI and I'm simply reading json from a file and applying schema on it, then finally sinking it to other folder.
My initial json looks like:

{"id": 2},
{"id": 3},
{"name": "abhijeet", "id": 4}

Final json also looks the same:

{"id": 2},
{"id": 3},
{"name": "abhijeet", "id": 4}

My schema looks like:

{
 "type": "record",
 "name": "CustomerRecord",
 "fields": [
  {
   "name": "id",
   "type": "long"
  }
 ]
}

But, even after applying schema, I'm not sure why still the last record in my json still got passed through it.

96691-screenshot-2019-01-14-at-21150-pm.png

96690-screenshot-2019-01-14-at-21136-pm.png

96689-screenshot-2019-01-14-at-21125-pm.png

96688-screenshot-2019-01-14-at-21102-pm.png

96687-screenshot-2019-01-14-at-20538-pm.png

1 REPLY 1

Re: Not sure why schema registry is not working

Super Guru

@Abhijeet Kumar

In your flow you are not changing any flowfile contents, Use ConvertRecord processor after UpdateAttribute processor.

Sample Flow:

1.GetFile
2.UpdateAttribute
3.ConvertRecord //use already defined json reader/writer controller services
4.PutFile

Refer this link for more details/usage of ConvertRecord processor.