Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Jun 6, 2023
1 parent 6cf62c1 commit 89bf9d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions formats/avro-turbo/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# CloudEvents Avro Format
# CloudEvents Avro Turbo Format

This project provides functionality for the Java SDK to handle the
[avro format](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md).
[avro turbo format](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-turbo-format.md).

The Avro definition file is located in src/main/avro/spec.proto. The file was directly
copied from [https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/cloudevents.avsc]().

The namespace has been changed so it does not clash with the core namespace.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

/**
* An implementation of {@link EventFormat} for <a href="github.com/cloudevents/spec/blob/v1.0.1/avro-format">the Avro format</a>.
* This format is resolvable with {@link io.cloudevents.core.provider.EventFormatProvider} using the content type {@link #AVRO_CONTENT_TYPE}.
* This format is resolvable with {@link io.cloudevents.core.provider.EventFormatProvider} using the content type {@link #AVRO_TURBO_CONTENT_TYPE}.
* It only supports data that is bytes.
*/
public class AvroTurboFormat implements EventFormat {

public static final String AVRO_CONTENT_TYPE = "application/cloudevents+avroturbo";
public static final String AVRO_TURBO_CONTENT_TYPE = "application/cloudevents+avroturbo";

@Override
public byte[] serialize(CloudEvent from) throws EventSerializationException {
Expand Down Expand Up @@ -122,6 +122,6 @@ else if (value instanceof ByteBuffer)

@Override
public String serializedContentType() {
return AVRO_CONTENT_TYPE;
return AVRO_TURBO_CONTENT_TYPE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

class AvroTurboFormatTest {

private final EventFormat format = EventFormatProvider.getInstance().resolveFormat(AvroTurboFormat.AVRO_CONTENT_TYPE);
private final EventFormat format = EventFormatProvider.getInstance().resolveFormat(AvroTurboFormat.AVRO_TURBO_CONTENT_TYPE);

// TODO - add test cases for
// - null data
Expand Down

0 comments on commit 89bf9d8

Please sign in to comment.