Converting XML Schema (XSD) to Protocol Buffers (Protobuf)

Sometimes one needs to derive a Google Protocol Buffers schema from an XML schema .. e.g. from an Enterprise Architect Export. Tool used here: schema2proto (GitLab project) Steps Download schema2proto-lib from the global Maven repository: https://search.maven.org/search?q=schema2proto Run Schema2Proto against a give XSD schema file and with a given output directory: java -jar schema2proto-lib-1.53.jar Schema2Proto --outputDirectory=src/main/protobuf input.xsd A yaml config file may be given instead of cli parameters: java -jar schema2proto-lib-1.53.jar Schema2Proto ----configFile=config.yaml input.xsd ...

February 2, 2022 · 1 min · 184 words · Micha Kops

Using Apache Avro with Java and Maven

Apache Avro is a serialization framework similar to Google’s Protocol Buffers or Apache Thrift and offering features like rich data structures, a compact binary format, simple integration with dynamic languages and more. In the following short five minute tutorial, we’re going to specify a schema to serialize books in a JSON format, we’re using the Avro Maven plugin to generate the stub classes and finally we’re serializing the data into a single file. ...

March 8, 2014 · 3 min · 573 words · Micha Kops

A look at Google’s Protocol Buffers

Protocol Buffers are a serialization format developed by Google- you might ask if another IDL is really needed here – is Google barking at the wrong tree? But protocol buffers offer some advantages over data serialization via XML or JSON – Google says they (compared to XML).. are 3 to 10 times smaller are 20 to 100 times faster provide generated data access classes for programmatic use provide backward compatibility ...

July 6, 2010 · 5 min · 1022 words · Micha Kops

JavaScript Snippets

Creating a Nodejs Module 1) Create a package.json using npm init $ npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sane defaults. See npm help json for definitive documentation on these fields and exactly what they do. Use npm install <pkg> --save afterwards to install a package and save it as a dependency in the package.json file. ...

March 1, 2010 · 3 min · 484 words · Micha Kops