Skip to content

Latest commit

 

History

History
 
 

json-jackson

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Json EventFormat implementation with Jackson

Javadocs

Implementation of EventFormat using Jackson.

For Maven:

<dependency>
    <groupId>io.cloudevents</groupId>
    <artifactId>cloudevents-json-jackson</artifactId>
    <version>2.0.0-milestone1 </version>
</dependency>

Usage

You don't need to perform any operation to configure the module, more than adding the dependency to your project:

CloudEvent event = CloudEventBuilder.v1()
  .withId("hello")
  .withType("example.vertx")
  .withSource(URI.create("http://localhost"))
  .build();

byte[] serialized = EventFormatProvider
  .getInstance()
  .resolveFormat(JsonFormat.CONTENT_TYPE)
  .serialize(event);