https://github.com/ballerina-platform/module-ballerinax-confluent.cregistry
The Ballerina Avro Ser/Des package for Confluent provides APIs which will hide the complexities in serializing and deserializing data using Avro schemas along with the registration and retrieval of these schemas from the schema registry
https://github.com/ballerina-platform/module-ballerinax-confluent.cregistry
avro ballerina confluent integration schema-registry
Last synced: 22 days ago
JSON representation
The Ballerina Avro Ser/Des package for Confluent provides APIs which will hide the complexities in serializing and deserializing data using Avro schemas along with the registration and retrieval of these schemas from the schema registry
- Host: GitHub
- URL: https://github.com/ballerina-platform/module-ballerinax-confluent.cregistry
- Owner: ballerina-platform
- License: apache-2.0
- Created: 2024-04-01T05:04:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-18T06:01:56.000Z (28 days ago)
- Last Synced: 2025-03-18T06:34:19.199Z (28 days ago)
- Topics: avro, ballerina, confluent, integration, schema-registry
- Language: Ballerina
- Homepage:
- Size: 249 KB
- Stars: 1
- Watchers: 50
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-kafka - ballerina-schema-registry - Ballerina Confluent Schema Registry (Libraries / Schema Registry)
README
# Ballerina Confluent Schema Registry Connector
[](https://github.com/ballerina-platform/module-ballerinax-confluent.cregistry/actions/workflows/ci.yml)
[](https://github.com/ballerina-platform/module-ballerinax-confluent.cregistry/actions/workflows/trivy-scan.yml)
[](https://github.com/ballerina-platform/module-ballerinax-confluent.cregistry/actions/workflows/build-with-bal-test-graalvm.yml)
[](https://github.com/ballerina-platform/module-ballerinax-confluent.cregistry/commits/main)
[](https://github.com/ballerina-platform/ballerina-library/labels/module%2Fconfluent.cregistry)
[](https://opensource.org/licenses/Apache-2.0)[Confluent Schema Registry](https://docs.confluent.io/platform/current/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.
```ballerina
import ballerinax/confluent.cregistry;
```### Step 2: Instantiate a new connector
```ballerina
configurable string baseUrl = ?;
configurable int identityMapCapacity = ?;
configurable map originals = ?;
configurable map 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.
```ballerina
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.
```bash
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](https://github.com/ballerina-platform/ballerina-library).
This repository only contains the source code for the package.
## Building from the source
### Prerequisites
1. Download and install Java SE Development Kit (JDK) version 21. You can download it from either of the following sources:
- [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
- [OpenJDK](https://adoptium.net/)> **Note:** After installation, remember to set the `JAVA_HOME` environment variable to the directory where JDK was installed.
2. Download and install [Ballerina Swan Lake](https://ballerina.io/).
3. Download and install [Docker](https://www.docker.com/get-started).
> **Note**: Ensure that the Docker daemon is running before executing any tests.
4. Generate a Github access token with read package permissions, then set the following `env` variables:
```bash
export packageUser=
export packagePAT=
```### Build options
Execute the commands below to build from the source.
1. To build the package:
```bash
./gradlew clean build
```2. To run the tests:
```bash
./gradlew clean test
```3. To build the without the tests:
```bash
./gradlew clean build -x test
```4. To debug package with a remote debugger:
```bash
./gradlew clean build -Pdebug=
```5. To debug with Ballerina language:
```bash
./gradlew clean build -PbalJavaDebug=
```6. Publish the generated artifacts to the local Ballerina central repository:
```bash
./gradlew clean build -PpublishToLocalCentral=true
```7. Publish the generated artifacts to the Ballerina central repository:
```bash
./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](https://github.com/ballerina-platform/ballerina-lang/blob/master/CONTRIBUTING.md).
## Code of conduct
All contributors are encouraged to read the [Ballerina Code of Conduct](https://ballerina.io/code-of-conduct).
## Useful links
- Discuss code changes of the Ballerina project in [[email protected]](mailto:[email protected]).
- Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.