Awesome
Ballerina Confluent Schema Registry Connector
Confluent Schema Registry serves as a centralized repository for managing Avro schemas, ensuring data consistency and compatibility in serialization and deserialization processes.
The Ballerina Confluent Schema Registry connector integrates with Confluent's Avro Schema Registry, providing users to efficiently manage schemas within Ballerina applications.
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.
import ballerinax/confluent.cregistry;
Step 2: Instantiate a new connector
configurable string baseUrl = ?;
configurable int identityMapCapacity = ?;
configurable map<anydata> originals = ?;
configurable map<string> headers = ?;
cregistry:Client schemaRegistryClient = check new ({
baseUrl,
identityMapCapacity,
originals,
headers
});
Step 3: Invoke the connector operation
You can now utilize the operations available within the connector.
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
Issues and projects
The Issues and Projects tabs are disabled for this repository as this is part of the Ballerina library. To report bugs, request new features, start new discussions, view project boards, etc., visit the Ballerina library parent repository.
This repository only contains the source code for the package.
Building from the source
Prerequisites
-
Download and install Java SE Development Kit (JDK) version 17. You can download it from either of the following sources:
Note: After installation, remember to set the
JAVA_HOME
environment variable to the directory where JDK was installed. -
Download and install Ballerina Swan Lake.
-
Download and install Docker.
Note: Ensure that the Docker daemon is running before executing any tests.
-
Generate a Github access token with read package permissions, then set the following
env
variables:export packageUser=<Your GitHub Username> export packagePAT=<GitHub Personal Access Token>
Build options
Execute the commands below to build from the source.
-
To build the package:
./gradlew clean build
-
To run the tests:
./gradlew clean test
-
To build the without the tests:
./gradlew clean build -x test
-
To debug package with a remote debugger:
./gradlew clean build -Pdebug=<port>
-
To debug with Ballerina language:
./gradlew clean build -PbalJavaDebug=<port>
-
Publish the generated artifacts to the local Ballerina central repository:
./gradlew clean build -PpublishToLocalCentral=true
-
Publish the generated artifacts to the Ballerina central repository:
./gradlew clean build -PpublishToCentral=true
Contributing to Ballerina
As an open source project, Ballerina welcomes contributions from the community.
For more information, go to the contribution guidelines.
Code of conduct
All contributors are encouraged to read the Ballerina Code of Conduct.
Useful links
- Discuss code changes of the Ballerina project in ballerina-dev@googlegroups.com.
- Chat live with us via our Discord server.
- Post all technical questions on Stack Overflow with the #ballerina tag.