Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sonsoleslp committed Sep 13, 2018
1 parent ff3d7ea commit 2d6a2e7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# fiware-cosmos-orion-flink-connector
# Introduction

This is a Flink connector for the Fiware Orion Context Broker.
It has two parts:
Expand All @@ -7,7 +7,7 @@ It has two parts:

* **`OrionSink`**: Sink for writing back to the Context Broker.

## Installation
# Installation

Download the JAR from the latest release.
In your project directory run:
Expand All @@ -24,8 +24,8 @@ Add it to your `pom.xml` file inside the dependencies section
</dependency>
```

## Usage
### OrionSource
# Usage
## OrionSource

* Import dependency
```
Expand Down Expand Up @@ -67,7 +67,7 @@ The received data is a DataStream of objects of the class **`NgsiEvent`**. This
* **`metadata`**: Additional metadata.


### OrionSink
## OrionSink
* Import dependency
```
import org.fiware.cosmos.orion.flink.connector.{OrionSink,OrionSinkObject,ContentType,HTTPMethod}
Expand All @@ -86,6 +86,7 @@ val processedDataStream = eventStream.
OrionSink.addSink( processedDataStream )
```

The sink accepts a `DataStream` of objects of the class **`OrionSinkObject`**. This class has 4 attributes:

- **`content`**: Message content in String format. If it is a JSON, you need to make sure to stringify it before sending it.
Expand All @@ -96,6 +97,6 @@ The sink accepts a `DataStream` of objects of the class **`OrionSinkObject`**. T

- **`method`**: HTTP method of the message. It can be `HTTPMethod.POST`, `HTTPMethod.PUT` or `HTTPMethod.PATCH`.

## Production
# Production

When packaging your code in a JAR, it is common to exclude dependencies like Flink and Scala since they are typically provided by the execution environment. Nevertheless, it is necessary to include this connector in your packaged code, since it is not part of the Flink distribution.

0 comments on commit 2d6a2e7

Please sign in to comment.