Skip to content

albrechtflo-hg/sdk-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java SDK for CloudEvents API

Build Status License Maven Central Javadocs

A Java API for the CloudEvents specification

Motivation

The CloudEvents specification is a vendor-neutral specification for defining the format of event data that is being exchanged between different cloud systems. The specification basically defines an abstract envelope for any event data payload, without knowing specific implementation details of the actual underlying event. The current version of the spec is at 0.2 and it describes a simple event format, which was demonstrated at KubeCon 2018 using different Serverless platforms, such as Apache Openwhisk.

Java API

For Maven based projects, use the following to configure the CloudEvents Java SDK:

<dependency>
    <groupId>io.cloudevents</groupId>
    <artifactId>cloudevents-api</artifactId>
    <version>0.2.1</version>
</dependency>

Application developers can now create strongly-typed CloudEvents, such as:

// given
final String eventId = UUID.randomUUID().toString();
final URI src = URI.create("/trigger");
final String eventType = "My.Cloud.Event.Type";
final MyCustomEvent payload = ...

// passing in the given attributes
final CloudEvent<MyCustomEvent> cloudEvent = new CloudEventBuilder<MyCustomEvent>()
    .type(eventType)
    .id(eventId)
    .source(src)
    .data(payload)
    .build();

Possible Integrations

The API is kept simple, for allowing a wide range of possible integrations:

About

Java SDK for CloudEvents

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%