Schema registry can be used in various scenarios. In this page, the configurations for different use-cases are listed.You can find the related parameters that you need the use in the configurations from Upstash Console.
Scroll down to the REST API section to find the values you need:
If you need to configure your producers to use the schema registry, add the following properties to producer properties in addition to the broker configurations. Note that the selected deserializer needs to be schema-registry aware.
Copy
Ask AI
Properties props = new Properties();// ... other configurations like broker.url and broker authentication are skippedprops.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");props.put("value.serializer, "io.confluent.kafka.serializers.KafkaAvroSerializer");props.put("schema.registry.url", UPSTASH_KAFKA_REST_URL + "/schema-registry");props.put("basic.auth.credentials.source", "USER_INFO");props.put("basic.auth.user.info", UPSTASH_KAFKA_REST_USERNAME + ":" + UPSTASH_KAFKA_REST_PASSWORD);try (var producer = new KafkaProducer<String, org.apache.avro.GenericRecord>(props)) { // ... }
If you need to configure your consumers to use the schema registry, add the following
properties to consumer properties in addition to the broker configurations.
Note that the selected deserializer needs to be schema-registry aware.
Copy
Ask AI
Properties props = new Properties();// ... other configurations like broker.url and broker authentication are skippedprops.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");props.put("value.deserializer, "io.confluent.kafka.serializers.KafkaAvroDeserializer");props.put("schema.registry.url", "$UPSTASH_KAFKA_REST_URL/schema-registry");props.put("basic.auth.credentials.source", "USER_INFO");props.put("basic.auth.user.info", UPSTASH_KAFKA_REST_USERNAME + ":" + UPSTASH_KAFKA_REST_PASSWORD);try(var consumer = new KafkaConsumer<String, org.apache.avro.GenericRecord>(props)) { // ...}
Some connectors forces you to use a STRUCT as key/value which means that you need a schema and a schema aware convertor to use with the connector.
For this case, you can add the following configurations to your connector.