Support Questions
Find answers, ask questions, and share your expertise

PublishKafkaRecord_2_6 with JsonRecordSetWriter

Highlighted

PublishKafkaRecord_2_6 with JsonRecordSetWriter

New Contributor

In Apache NiFi, I am currently using PublishKafkaRecord_2_6 to write JSON data to a Kafka topic. I am using the JsonRecordSetWriter for the Record Writer, and I would like to use the "Confluent Schema Registry Reference" as the Schema Write Strategy(I have also set the JSON schema in the Kafka topic):

 

Current settings for PublishKafkaRecord_2_6:

Record Reader: JsonTreeReader

  • Schema Access Strategy: Infer Schema

Record Writer: JsonRecordSetWriter

  • Schema Write Strategy: Confluent Schema Registry Reference
  • Schema Access Strategy: Use 'Schema Name' Property
  • Schema Registry: ConfluentSchemaRegistry
  • Schema Name: test-topic-name

 

but I get the following error:

PublishKafkaRecord_2_6 Failed to send StandardFlowFileRecord to Kafka: org.apache.nifi.processor.exception.ProcessException: org.apache.nifi.schema.access.SchemaNotFoundException: Could not retrieve schema with name 'test-topic-name' from the configured Schema Registry.

 

I have also tried setting Schema Name to 'test-topic-name-value' and 'value_test-topic-name' and have gotten a similar error. 

 

It is also worth noting that when I tried to use PublishKafkaRecord_2_6 with the JsonTreeReader and AvroRecordSetWriter with the following settings, I had no issues(I also set the Avro schema for the Kafka topic beforehand): 

Record Reader: JsonTreeReader

  • Schema Access Strategy: Infer Schema

Record Writer: AvroRecordSetWriter

  • Schema Write Strategy: Confluent Schema Registry Reference
  • Schema Access Strategy: Use 'Schema Name' Property
  • Schema Registry: ConfluentSchemaRegistry
  • Schema Name: test-topic-name-value

Is there a way to configure the JsonRecordSetWriter so that it will use the "Confluent Schema Registry Reference" as the Schema Write Strategy?

1 REPLY 1

Re: PublishKafkaRecord_2_6 with JsonRecordSetWriter

Master Guru

@Melissa 

 

It may be helpful if you can share screenshots of your controller services (JsonTreeReader and JsonRecordSetWriter complete configurations) and the complete exception written to the nifi-app.log.