avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Avro Client-Server - generic vs specific
Date Tue, 01 Oct 2013 18:41:52 GMT
On Tue, Oct 1, 2013 at 10:57 AM, michaƂ <michal.one1337@gmail.com> wrote:
> 1. Would it be possible to program client-server and generate the protocol
> classes programmatically at compile time?

Yes.  This is supported through Avro's Maven plugins by adding
something like the following to your pom.xml:

<plugin>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro-maven-plugin</artifactId>
  <version>${avro.version}</version>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>schema</goal>
        <goal>protocol</goal>
        <goal>idl-protocol</goal>
      </goals>
    </execution>
  </executions>
</plugin>

This will compile .avpr files from src/main/avro, generating .avsc and
.avpr files in target/generated-sources/avro, then compile these to
create .java files in target/generated-sources/java which will be
compiled by the normal Maven java compilation plugins.

Doug

Mime
View raw message