5.0

Schema Registry

Basic information 

Working with records serialized in AVRO format requires schemas. The simplest way to provide schemas is a Schema Registry.. Lenses supports Confluent’s Schema Registry and any other registry that implements its API.

Once a Schema Registry connection is defined, Lenses displays all Schema Registry nodes and their statuses (with metrics, if configured so) in Workspace -> Services screen.

Apart from the Connection, there are following static config (lenses.conf) entries that might be used to enable schema deletions.

# Enable schema deletion in the Lenses UI
# default : false
lenses.schema.registry.delete = true

# When a topic is deleted,
# automatically delete also its associated Schema Registry subjects
# default: false
lenses.schema.registry.cascade.delete = true

Connection details 

Like other core services, Schema Registry is managed via Connections. See more about managing connections here .

Multiple connections allowed: NO

Deletion allowed: YES

When managing connections other than with GUI, such information are relevant for Schema Registry connection:

Template name: SchemaRegistry

Constant connection name: schema-registry

Examples 

The easiest way to manage Connections is via Lenses GUI under their respective pages, however it is also possible to do it directly via API, Helm or Lenses CLI. In such case, some connection type-specific values have to be used. Here are few examples of such configuration in YAML format.

  • Find out more about managing Schema Registry Connection via API
  • Find out more about managing Connections via Lenses CLI provision
  • Find out more about installing Lenses via Helm

Simple configuration, with JMX metrics 

The URLs (nodes) should always have a scheme defined (http:// or https://).

  schema-registry:
    tags: [ "tag1" ]
    templateName: SchemaRegistry
    configurationObject:
      schemaRegistryUrls:
        - http://my-sr.host1:8081
        - http://my-sr.host2:8081
      # all metrics properties are optional 
      metricsPort: 9581
      metricsType: JMX
      metricsSsl: false

Misc metrics configurations 

Find more about multiple options of configuring services’ metrics (like secured JMX, Jolokia, etc) under Services Metrics

Basic authentication 

For Basic Authentication, define username and password properties.

  schema-registry:
    templateName: SchemaRegistry
    tags: [ ]
    configurationObject:
      schemaRegistryUrls:
        - http://my-sr.host1:8081
        - http://my-sr.host2:8081
      username: my-username
      password: my-password

TLS with custom truststore 

A custom truststore is needed when the Schema Registry is served over TLS (encryption-in-transit) and the Registry’s certificate is not signed by a trusted CA.

  schema-registry:
    templateName: SchemaRegistry
    tags: [ ]
    configurationObject:
      schemaRegistryUrls:
        - https://my-sr.host1:8081
        - https://my-sr.host2:8081
      sslTruststore:
        fileRef:
          filePath: /path/to/my/truststore.jks
      sslTruststorePassword: myPassword

TLS with client authentication 

A custom truststore might be necessary too (see above).

  schema-registry:
    name: schema-registry
    templateName: SchemaRegistry
    tags: [ ]
    configurationObject:
      schemaRegistryUrls:
        - https://my-sr.host1:8081
        - https://my-sr.host2:8081
      sslKeystore:
        fileRef:
          filePath: /path/to/my/keystore.jks
      sslKeyPassword: keyPassword
      sslKeystorePassword: keystorePassword

TLS with Basic Authentication 

A custom truststore might be necessary too (see above).

  schema-registry:
    name: schema-registry
    templateName: SchemaRegistry
    tags: [ ]
    configurationObject:
      schemaRegistryUrls:
        - https://my-sr.host1:8081
        - https://my-sr.host2:8081
      username: test
      password: test

Advanced properties 

In very rare cases some custom properties related to Schema Registry might be necessary. They can be passed as additionalProperties, as shown in below example.

  schema-registry:
    tags: [ "tag1" ]
    templateName: SchemaRegistry
    configurationObject:
      schemaRegistryUrls:
        - http://my-sr.host1:8081
        - http://my-sr.host2:8081
      additionalProperties:
        specific.avro.reader: "false"
        avro.reflection.allow.null: "false"
        avro.remove.java.properties: "false"
        avro.use.logical.type.converters: "false"