Git Product home page Git Product logo

schema-registry-dotnet's Introduction

schema-registry-dotnet

.Net wrapper for the Confluent Schema Registry REST API. Nuget package: https://www.nuget.org/packages/SchemaRegistry/

REST API usage:

using (var registry = new SchemaRegistryApi("http://schema-registry.my-company.com"))
{
    // Get first 10 subjects
    var subjects = registry.GetAllSubjects().Result.Take(10);
    Console.WriteLine("First 10 subjects: " + String.Join(", ", subjects));

    // Get last schema by subject
    var subject = subjects.First();
    var meta = registry.GetLatestSchemaMetadata(subject).Result;
    Console.WriteLine($"Last version of the {subject} subject: {meta.Version}");

    // Check schema compatibiliy
    var isCompatible = registry.TestCompatibility(subject, meta.Schema).Result;
    Console.WriteLine($"Is the schema compatible to itself: {isCompatible}");

    // Register the schema (returns the same ID for identical schema)
    var newSchemaId = registry.Register(subject, meta.Schema).Result;
    Console.WriteLine($"Schema id: {newSchemaId}");
}

There's also RegistryAwareSerializer class, which implements Confluent's AVRO+Schema registry convention.

On serialize:

  • Access Schema Registry to check Schema compatibility and get Schema ID (statically cached)
  • Write prefix containing the 0 magic byte and the schema ID to the message

On deserialize:

  • Reads message prefix to check magic 0 byte and extract Schema ID
  • Access Schema Registry to get Schema
  • Provides retrieved schema as Writer Schema to the serializer

AVRO serializer implementation is pluggable. Example implementation for Confluent Apache AVRO library is included in tests

schema-registry-dotnet's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

schema-registry-dotnet's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.