Skip to content

Commit 6575ac5

Browse files
committed
(chore) initial commit
Signed-off-by: Ning Sun <[email protected]>
1 parent 5a32394 commit 6575ac5

File tree

11 files changed

+245
-0
lines changed

11 files changed

+245
-0
lines changed

formats/avro/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# CloudEvents Avro Format
2+
3+
This project provides functionality for the Java SDK to handle the
4+
[avro format](https://github.com/cloudevents/spec/blob/v1.0.1/avro-format.md).

formats/avro/pom.xml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2021-Present The CloudEvents Authors
4+
~ <p>
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~ <p>
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~ <p>
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
~
17+
-->
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
23+
<parent>
24+
<groupId>io.cloudevents</groupId>
25+
<artifactId>cloudevents-parent</artifactId>
26+
<version>2.3.0-SNAPSHOT</version>
27+
<relativePath>../../pom.xml</relativePath>
28+
</parent>
29+
30+
<artifactId>cloudevents-avro</artifactId>
31+
<name>CloudEvents - Avro</name>
32+
<packaging>jar</packaging>
33+
34+
<properties>
35+
<avro.version>1.10.2</avro.version>
36+
<module-name>io.cloudevents.formats.avro</module-name>
37+
</properties>
38+
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.avro</groupId>
43+
<artifactId>avro-maven-plugin</artifactId>
44+
<version>1.10.2</version>
45+
<executions>
46+
<execution>
47+
<phase>generate-sources</phase>
48+
<goals>
49+
<goal>schema</goal>
50+
</goals>
51+
<configuration>
52+
<sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
53+
54+
<outputDirectory>${project.build.directory}/generated-sources/java/</outputDirectory>
55+
</configuration>
56+
</execution>
57+
</executions>
58+
</plugin>
59+
<plugin>
60+
<groupId>org.codehaus.mojo</groupId>
61+
<artifactId>build-helper-maven-plugin</artifactId>
62+
<executions>
63+
<execution>
64+
<id>add-source</id>
65+
<phase>generate-sources</phase>
66+
<goals>
67+
<goal>add-source</goal>
68+
</goals>
69+
<configuration>
70+
<sources>
71+
<source>${project.build.directory}/generated-sources/java/</source>
72+
</sources>
73+
</configuration>
74+
</execution>
75+
</executions>
76+
</plugin>
77+
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-compiler-plugin</artifactId>
81+
<configuration>
82+
<source>1.8</source>
83+
<target>1.8</target>
84+
</configuration>
85+
</plugin>
86+
</plugins>
87+
</build>
88+
89+
<dependencies>
90+
<dependency>
91+
<groupId>io.cloudevents</groupId>
92+
<artifactId>cloudevents-core</artifactId>
93+
<version>${project.version}</version>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>org.apache.avro</groupId>
98+
<artifactId>avro</artifactId>
99+
<version>1.10.2</version>
100+
</dependency>
101+
102+
<!-- Test deps -->
103+
<dependency>
104+
<groupId>org.junit.jupiter</groupId>
105+
<artifactId>junit-jupiter</artifactId>
106+
<version>${junit-jupiter.version}</version>
107+
<scope>test</scope>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>org.assertj</groupId>
112+
<artifactId>assertj-core</artifactId>
113+
<version>${assertj-core.version}</version>
114+
<scope>test</scope>
115+
</dependency>
116+
117+
<dependency>
118+
<groupId>io.cloudevents</groupId>
119+
<artifactId>cloudevents-core</artifactId>
120+
<classifier>tests</classifier>
121+
<type>test-jar</type>
122+
<version>${project.version}</version>
123+
<scope>test</scope>
124+
</dependency>
125+
126+
</dependencies>
127+
128+
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
io.cloudevents.avro.AvroFormat
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"specVersion": "0.3",
3+
"id": "1",
4+
"type": "mock.test",
5+
"source": "http://localhost/source"
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"specVersion": "1.0",
3+
"id": "1",
4+
"type": "mock.test",
5+
"source": "http://localhost/source",
6+
"attributes" : {
7+
"binary": {
8+
"ceBytes" : "4P8ARKo="
9+
}
10+
}
11+
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"specVersion": "1.0",
3+
"id": "1",
4+
"type": "mock.test",
5+
"source": "http://localhost/source",
6+
"attributes": {
7+
"time": {
8+
"ceTimestamp": "2018-04-26T14:48:09+02:00"
9+
},
10+
"dataschema": {
11+
"ceUri": "http://localhost/schema"
12+
},
13+
"datacontenttype": {
14+
"ceString": "application/json"
15+
},
16+
"subject": {
17+
"ceString": "sub"
18+
}
19+
},
20+
"textData": "{}"
21+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"specVersion": "1.0",
3+
"id": "1",
4+
"type": "mock.test",
5+
"source": "http://localhost/source",
6+
"attributes": {
7+
"dataschema": {
8+
"ceUri": "http://localhost/schema"
9+
},
10+
"datacontenttype": {
11+
"ceString": "application/json"
12+
},
13+
"subject": {
14+
"ceString": "sub"
15+
},
16+
"time": {
17+
"ceTimestamp": "2018-04-26T14:48:09+02:00"
18+
},
19+
"astring": {
20+
"ceString": "aaa"
21+
},
22+
"aboolean": {
23+
"ceBoolean": true
24+
},
25+
"anumber": {
26+
"ceInteger": 10
27+
}
28+
},
29+
"textData": "{}"
30+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "1",
3+
"source": "http://localhost/source",
4+
"specVersion": "1.0",
5+
"type": "mock.test"
6+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"specVersion": "1.0",
3+
"id": "1",
4+
"type": "mock.test",
5+
"source": "http://localhost/source",
6+
"attributes": {
7+
"time": {
8+
"ceTimestamp": "2018-04-26T14:48:09+02:00"
9+
},
10+
"subject": {
11+
"ceString": "sub"
12+
},
13+
"datacontenttype": {
14+
"ceString": "text/plain"
15+
}
16+
},
17+
"textData": "Hello World Lorena!"
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"specVersion": "1.0",
3+
"id": "1",
4+
"type": "mock.test",
5+
"source": "http://localhost/source",
6+
"attributes": {
7+
"time": {
8+
"ceTimestamp": "2018-04-26T14:48:09+02:00"
9+
},
10+
"datacontenttype": {
11+
"ceString": "application/xml"
12+
},
13+
"subject": {
14+
"ceString": "sub"
15+
}
16+
},
17+
"textData": "<stuff></stuff>"
18+
}

0 commit comments

Comments
 (0)