Skip to content
Open
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
62 changes: 4 additions & 58 deletions java-gcp-dataflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,70 +8,16 @@ Before following this guide we recommend completing the basic [Java + Rookout tu

This example is based of the Java word-count-beam example available [here].

1. Add your sources to the package:
1. Before executing the pipeline run [here](https://beam.apache.org/get-started/wordcount-example/#:~:text=section%2C%20MinimalWordCount.-,To%20run%20this%20example%20in%20Java,-%3A), export Rookout Environmnet variables:
```xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash :)

<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
</resource>
</resources>
export ROOK_AGENT_JAR="/YourPath/rook.jar"
```

2. We imported Rookout packages and the Google services API to the project jar(`pom.xml`):
```xml
<dependency>
<groupId>com.rookout</groupId>
<artifactId>rook</artifactId>
<version>LATEST</version>
</dependency>

<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0.13</version>
</dependency>

<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0-rc6</version>
</dependency>
export JAVA_TOOL_OPTIONS="-javaagent:$ROOK_AGENT_JAR -DROOKOUT_TOKEN=<Your_Token>"
```

3. Add nuiton repository to your repositories section:
```xml
<repository>
<id>nuiton</id>
<name>nuiton</name>
<url>http://maven.nuiton.org/release/</url>
</repository>
```
4. Adding the RookoutJvmInitializer class to your solution
```java
package <YOUR-PACKAGE>;

import com.rookout.rook.API;
import com.rookout.rook.RookOptions;
import org.apache.beam.sdk.harness.JvmInitializer;
import org.apache.beam.sdk.options.PipelineOptions;
import com.google.auto.service.AutoService;
import java.util.HashMap;

@AutoService(JvmInitializer.class)
public class RookoutJvmInitializer implements JvmInitializer {
@Override
public void beforeProcessing(PipelineOptions options) {
RookOptions opts = new RookOptions();
opts.token = "<YOUR-TOKEN>";
opts.labels = new HashMap<String, String>() {{
put("env", "prod");
}};
API.start(opts);
}
}
```

5. Deploy your app and go to [http://app.rookout.com](http://app.rookout.com) and start debugging!
2. Deploy your app and go to [http://app.rookout.com](http://app.rookout.com) and start debugging!

[Java + Rookout]: https://docs.rookout.com/docs/sdk-setup.html
[here]: https://beam.apache.org/get-started/wordcount-example/
Expand Down