Skip to content
This repository has been archived by the owner on Nov 13, 2019. It is now read-only.

Clean up the old code, add deprecation note #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 3 additions & 73 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,75 +1,5 @@
= Implementation of the CloudEvents Specification
= DEPRECATED

image:https://api.travis-ci.org/project-streamzi/jcloudevents.png[Build Status (Travis CI), link=https://travis-ci.org/project-streamzi/jcloudevents]
image:https://img.shields.io/:license-Apache2-blue.svg[License, link=http://www.apache.org/licenses/LICENSE-2.0]
The CloudEvents API got promoted to the CNCF repo:

Simple CDI libray for the link:https://github.com/cloudevents/spec[CloudEvents Specification]

A more detailed introduction is link:./introduction.md[here]

Below is a simple overview!

== JAX-RS and Apache Kafka support

Adding the `jax-rs` or `kafka` module to your application integrates, either the `/ce` JAX-RS endpoint, or a configurable Kafka consumer for handling CloudEvents from within your application!

Receiving different multi-cloud events, using the CDI API:

[source,java]
----
public class Monitor {

public void receiveCloudEventFromAWS(@Observes @EventType(name = "aws.s3.object.created") CloudEvent<?> cloudEvent) {

System.out.println("S3 event: " + cloudEvent);

}
public void receiveCloudEventFromAzure(@Observes @EventType(name = "Microsoft.Storage.BlobCreated") CloudEvent<?> cloudEvent) {

System.out.println("Azure event: " + cloudEvent);

}
}
----

== Java SE / Weld-SE support

Vanilla CDI support and APIs for CloudEvents

=== Creating and firing an event:

[source,java]
----
public class EventPublisher {

@Inject
private Event<CloudEvent<MyCustomEvent>> cloudEvent;

public void doAndTrigger() throws Exception {

// do some domain specific stuff...

CloudEvent<MyCustomEvent> event = new CloudEventBuilder<MyCustomEvent>()
.eventType("Cloud.Storage.Item.Created")
.source(new URI("/trigger"))
.eventID(UUID.randomUUID().toString())
.build();

cloudEvent.select(
new EventTypeQualifier("Cloud.Storage.Item.Created"))
.fire(event);

}
}
----

=== Receiving the event

[source,java]
----
...
public void receiveCloudEvent(@Observes @EventType(name = "Cloud.Storage.Item.Created") CloudEvent cloudEvent) {

receiver.ack();
}
----
* https://github.com/cloudevents/sdk-java
104 changes: 0 additions & 104 deletions jax-rs/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
99 changes: 0 additions & 99 deletions kafka/pom.xml

This file was deleted.

This file was deleted.

Loading