ballerinax/confluent.cregistry Ballerina library

0.4.4

Overview

Confluent Schema Registry serves as a centralized repository for managing Avro schemas, ensuring data consistency and compatibility in serialization and deserialization processes.

The Confluent Schema Registry connector integrates with Confluent's Avro Schema Registry, allowing users to efficiently manage schemas.

Key Features

  • Centralized repository for managing Avro schemas
  • Ensures data consistency and compatibility
  • Efficient schema management and integration

Quickstart

To use the Confluent schema registry connector in your Ballerina project, modify the .bal file as follows.

Step 1: Import the module

Import the ballerinax/confluent.cregistry module into your Ballerina project.

Copy
import ballerinax/confluent.cregistry;

Step 2: Instantiate a new connector

Copy
configurable string schemaRegistryUrl = ?;
configurable string apiKey = ?;
configurable string apiSecret = ?;
configurable string truststorePath = ?;
configurable string truststorePassword = ?;

cregistry:Client schemaRegistryClient = check new (
    baseUrl = schemaRegistryUrl,
    originals = {
      "basic.auth.credentials.source": "USER_INFO",
      "basic.auth.user.info": string `${apiKey}:${apiSecret}`
      // Truststore configurations are optional when the schema registry's HTTP(S) endpoint is secured with a publicly trusted certificate.
      "schema.registry.ssl.truststore.location": truststorePath,
      "schema.registry.ssl.truststore.password": truststorePassword,
    }
);

Step 3: Invoke the connector operation

You can now utilize the operations available within the connector.

Copy
public function main() returns error? {
    string schema = string `
        {
            "type": "int",
            "name" : "value", 
            "namespace": "data"
        }`;

    int registerResult = check schemaRegistryClient.register("subject-name", schema);
}

Step 4: Run the Ballerina application

Use the following command to compile and run the Ballerina program.

bal run

Import

import ballerinax/confluent.cregistry;Copy

Other versions

See more...

Metadata

Released date: about 18 hours ago

Version: 0.4.4

License: Apache-2.0


Compatibility

Platform: java21

Ballerina version: 2201.11.0

GraalVM compatible: Yes


Pull count

Total: 25799

Current verison: 58


Weekly downloads


Source repository


Keywords

Messaging/Schema Registry

Cost/Freemium

Vendor/Confluent

Area/Messaging

Type/Connector


Contributors