Giter Club home page Giter Club logo

schema-registry-plugin's Introduction

CircleCI

Schema-registry-plugin

The aim of this plugin is to adapt the Confluent schema registry maven plugin for Gradle builds.

See gradle plugins portal for instructions about how to add the plugin to your build configuration.

When you do so, three tasks are added under registry group:

  • downloadSchemasTask
  • testSchemasCompatibilityTask
  • registerSchemasTask What these tasks do and how to configure them is described in the following sections.

Download schemas

Like the name of the task imply, this task is responsible of retrieving schemas from a schema registry.

A DSL is available to configure the task:

schemaRegistry {
    url = 'http://localhost:8081/'
    download {
        subject('topic1-key', 'src/main/avro')
        subject('topic1-value', 'src/main/avro/values')
    }
}

You have to put the url where the script can reach the Schema Registry.

You need to specify the pairs (subjectName, outputDir) for all the schemas you want to download.

Test schemas compatibility

This task test compatibility between local schemas and schemas stored in the Schema Registry.

A DSL is available to specify what to test:

schemaRegistry {
    url = 'http://localhost:8081'
    compatibility {
        subject('mySubject', 'file/path.avsc')
        subject('otherSubject', 'other/path.avsc')
    }
}

You have to put the url where the script can reach the Schema Registry.

You have to list all the (subject, avsc file path) pairs that you want to test.

Register schemas

Once again the name speaks for itself. This task register schemas from a local path to a Schema Registry.

A DSL is available to specify what to register:

schemaRegistry {
    url = 'http://localhost:8081'
    register {
        subject('mySubject', 'file/path.avsc')
        subject('otherSubject', 'other/path.avsc')
        subject('subjectWithDependencies', 'dependent/path.avsc', ['firstDependency/path.avsc', 'secondDependency/path.avsc'])
    }
}

You have to put the url where the script can reach the Schema Registry.

You have to list all the (subject, avsc file path) pairs that you want to send.

If you have dependencies with other schemas required before the register phase, you can add a third parameter with the needed paths.

The order of the file paths in the list is significant. Basically you need to follow the logical order of the types used. If an User need an Address record which itself needs a Street record you will need to define the dependencies like this:

register{
    subject('userSubject', 'path/user.avsc', ['path/address.avsc', 'path/street.avsc'])
}

schema-registry-plugin's People

Contributors

imflog avatar

Watchers

 avatar  avatar

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.