Giter VIP home page Giter VIP logo

avro-schema-examples's Introduction

avro-schema-examples

Showcase of using a maven repository as a Schema Repository.

Join the discussion on Gitter: Gitter chat

The examples here are built and published to:

Demonstrates:

  • Compose data models using maven dependency framework. Leverage maven to compose and re-use, version, release and publish avro data models. (see: test-schema depend-on test-schema-common)

  • Validate avro schemas (extensile). (documentation, compatibility with previously released versions, deprecation prrior to removal)

  • Add a unique ID to the schemas (mvnId = "group:artifact:version:id")

  • Generate and publish java classes. (publishing for other languages can se set up) (@Immmutable support, @Nullable/@Nonnull) see

  • Generate package and publish the avro schemas, see.

  • Generate and publish avrodoc to maven repo or gh-pages.

More schema project examples: https://github.com/zolyfarkas/core-schema

The pom file for a schema project is as simple as (see example from this repo for more detail):

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.spf4j.avro.examples</groupId>
  <artifactId>test-schema</artifactId>
  <packaging>jar</packaging>
  <version>1.5-SNAPSHOT</version>
  <name>${project.artifactId}-${project.version}</name>
  <description>Avro schema example</description>
   <parent>
     <groupId>org.spf4j.avro</groupId>
     <artifactId>schema-parent-pom</artifactId>
     <version>LATEST</version>
   </parent>
  <properties>
        <avro.version>LATEST</avro.version> <!-- change to use your own fork or official -->
        <avro.allowUndefinedLogicalTypes>false</avro.allowUndefinedLogicalTypes>
  </properties>
  <dependencies>
    <dependency> <!-- this schema will re-use schema's from this dependency -->
        <groupId>org.spf4j.avro.examples</groupId>
        <artifactId>test-schema-common</artifactId>
        <version>LATEST</version>
    </dependency>
  </dependencies>
</project>

The bulk of the functionality is implemented using:

avro-schema-examples's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kokolanako

avro-schema-examples's Issues

Publish avrodoc to gh-pages

Rather than linking to a JAR, I feel the information would be more consumable if hosted on a static site like Github Pages.

Provide more consumable way to use AVSC files rather than JARs

Avro supports more than just Java, so while packaging generated Java classes into a JAR is useful, putting the AVSC files into one, I feel, is not.

$ jar -tf test-schema-1.1-avsc.jar
org/spf4j/base/avro/JPackageInfo.avsc
org/spf4j/base/avro/JThrowable.avsc
org/spf4j/base/avro/TestRecord.avsc
org/spf4j/base/avro/JFileLocation.avsc
org/spf4j/base/avro/JStackTraceElement.avsc
org/spf4j/base/avro/LocalKeyValue.avsc
org/apache/avro/logicalTypes/AnyRecord.avsc
codegen.properties
schema_index.properties

Therefore, your comment on the Avro JIRA about "using a maven repo as a schema repo REST service" I feel doesn't quite hold until one unzips the JAR file.

Compare this to using the Confluent Schema Registry Maven Plugin which will publish the AVSC to a versioned, compatibility checked location that only requires an HTTP call to publish/receive.

If you would like to contribute/browse code of that project, you can find it here - https://github.com/confluentinc/schema-registry/tree/master/maven-plugin

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.