Does Confluent schema registry only support AVRO? - apache-kafka

Can we use schema registry for json messages and json schemas? Or is it like we have to use avro serialization for value serialization of messages.

Confluent schema registry also support JSON schema and Protobuf with the release of Confluent Platform 5.5. It has been announced in this blog.

Related

Integrating Flink Kafka with schema registry

We are using a confluent Platform for Kafka deployment. We are using a schema registry for storing schema. Is it possible to integrate schema registry with flink? How to read the data in AVRO format from confluent platform?
These classes are designed to meet this need
ConfluentRegistryAvroSerializationSchema
ConfluentRegistryAvroDeserializationSchema
See the linked JavaDoc for more info on the classes.
Each can be provided to the Kafka Connector via the respective serialization method arguments.
Flink SQL can also be used.

What is the use of confluent schema registry if Kafka can use Avro without it

The difference between vanilla apache Avro and Avro with confluent schema registry is that when using apache avro , we send schema+message in kafka topic whereas in confluent schema registry , we send schemaID+message in kafka topic ? So here , schema registry helps in performance improvement via schema look up in registry. Is there any other benefit of using confluent schema registry ? Also , does apache avro supports compatabilty rules of schema evolution like schema registry ?
Note: There are other implementations of a "Schema Registry" that can use used with Kafka.
Here are a list of reasons
Clients can discover schemas without interacting with Kafka. For example, Apache Hive / Presto / Spark can download schemas from the Registry to perform analytics.
The registry is centrally responsible for compatibility checks rather than pushing each client to operate that on their own (to answer your second question)
The same applies to any serialization format, as well, not only Avro

How to publish and consume nifi json to avro and avro to json content to kafka using NiFi

I am new to both NiFi and Avro. So, according to my understanding if we use schema registry the schema won't be added to Avro content that is being published to Kafka, only schema ID will be sent is that correct??
How can I publish and consume through Kafka using Horton works Schema Registry, using Avro serialization and deserialization?
In Nifi ConvertJsonToAvro schema will be embedded while sending.SO, is there any other processor which will use schema registry and won't send schema while publishing.
On publishing side you would use PublishKafkaRecord (with the version corresponding to your Kafka broker) and you would configure it with a JsonTreeReader and an AvroRecordSetWriter. In the record writer you would configure the Schema Write Strategy as Hortonworks Content Encoded.
On consuming side your would ConsumeKafkaRecord (same version as publish) and you would configure it with an AvroRecordReader and a JsonRecordWriter. In the reader you would configure the Schema Access Strategy as Hortonworks Content Encoded.

Does confluent-4.1.1 supports nested avro with ksql cli?

I am working on confluent-4.1.1 with ksql cli. Can I create stream for nested avro data format in this version as i tried with version-5 and it was working fine but no useful link found where mentioned about nested avro schema in confluent-4.1.1
I tried to create stream -
create stream new_order with(kafka_topic='transition',value_format='avro');
Got error -
Could not fetch the AVRO schema from schema registry. Cannot find correct type for avro type: transition.Value
Nested Avro support for KSQL was added in version 5.0 of Confluent Platform

Avro messages with schema

So we are planning to use Avro for communication over a confluent kafka-based ecosystem. My current understanding of Avro is that each message carries its schema. If that is the case, we need schema registry just for resolving version updates?
I ask since carrying the schema with each message prevents the need for something like a schema registry to map a message id to a schema. Or am I missing something here?
When you run the Confluent Schema Registry, the Kafka messages published with the Confluent Avro Serdes library do not contain the avro schema. They only contain a numeric Schema id that is used by the consumers deserializer to fetch the Schema from the Confluent Schema Registry. These schemas are cached by the serializer and deserializer as a further performance optimization.