📝 updating to 0.2.0 libraries for usage
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
This commit is contained in:
parent
192bfcaaa0
commit
ee8632a537
14
README.md
14
README.md
|
|
@ -13,7 +13,17 @@ The [CloudEvents specification](https://github.com/cloudevents/spec) is vendor-n
|
|||
|
||||
## Java API
|
||||
|
||||
Based on the specification we started to look at an early implementation of the API for Java. Using the API your backend application can create strongly-typed CloudEvents, such as:
|
||||
For Maven based projects, use the following to configure the CloudEvents Java SDK:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.cloudevents</groupId>
|
||||
<artifactId>cloudevents-api</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Application developers can now create strongly-typed CloudEvents, such as:
|
||||
|
||||
```java
|
||||
// given
|
||||
|
|
@ -33,7 +43,7 @@ final CloudEvent<MyCustomEvent> cloudEvent = new CloudEventBuilder<MyCustomEvent
|
|||
|
||||
## Possible Integrations
|
||||
|
||||
The idea on the API is to keep the pure API simple, for allowing a wide range of possible integrations
|
||||
The API kept simple, for allowing a wide range of possible integrations:
|
||||
|
||||
* [CDI](cdi/)
|
||||
* [Eclipse Vert.x](http/vertx/)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,17 @@
|
|||
|
||||
## Firing CloudEvents using CDI
|
||||
|
||||
In _Enterprise Java_ applications, implemented with Jakarta EE or the Eclipse Microprofile, it's trivial to combine this CloudEvents API with CDI. Application developers can now fire a CloudEvent for further processing inside of the application:
|
||||
For Maven based projects, use the following to configure the CloudEvents CDI library:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.cloudevents</groupId>
|
||||
<artifactId>cdi</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
In _Enterprise Java_ applications, implemented with [Jakarta EE](https://jakarta.ee/) or the [Eclipse MicroProfile](https://microprofile.io/), it's trivial to combine this CloudEvents API with CDI. Application developers can now fire a CloudEvent for further processing inside of the application:
|
||||
|
||||
```java
|
||||
import io.cloudevents.CloudEvent;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,16 @@
|
|||
|
||||
## Receiving CloudEvents
|
||||
|
||||
For Maven based projects, use the following to configure the CloudEvents Vertx HTTP Transport:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.cloudevents</groupId>
|
||||
<artifactId>http-vertx</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Below is a sample on how to use [Vert.x API for RxJava 2](https://vertx.io/docs/vertx-rx/java2/) for reading CloudEvents from an HttpServerRequest:
|
||||
|
||||
```java
|
||||
|
|
|
|||
Loading…
Reference in New Issue