Skip to content
This repository has been archived by the owner on May 21, 2020. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aserrallerios authored May 15, 2018
1 parent b0e6b33 commit 2d1e8b1
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For more information about KCL please visit the [official documentation](http://
<dependency>
<groupId>aserrallerios</groupId>
<artifactId>kcl-akka-stream_2.11</artifactId>
<version>0.3</version>
<version>0.4</version>
<type>pom</type>
</dependency>
```
Expand All @@ -47,29 +47,31 @@ val workerSourceSettings = KinesisWorkerSourceSettings(
bufferSize = 1000,
terminateStreamGracePeriod = 1 minute,
backpressureTimeout = 1 minute)
val builder: IRecordProcessorFactory => Worker = { recordProcessorFactory =>
new Worker.Builder()
.recordProcessorFactory(recordProcessorFactory)
.config(
new KinesisClientLibConfiguration(
"myApp",
"myStreamName",
DefaultAWSCredentialsProviderChain.getInstance(),
s"${
import scala.sys.process._
"hostname".!!.trim()
}:${java.util.UUID.randomUUID()}"
)

val builder: IRecordProcessorFactory => Worker = { recordProcessorFactory =>
new Worker.Builder()
.recordProcessorFactory(recordProcessorFactory)
.config(
new KinesisClientLibConfiguration(
"myApp",
"myStreamName",
DefaultAWSCredentialsProviderChain.getInstance(),
s"${
import scala.sys.process._
"hostname".!!.trim()
}:${java.util.UUID.randomUUID()}"
)
.build()
}
)
.build()
}
```

The Source also needs an `ExecutionContext` to run the Worker's thread and to commit/checkpoint records. Then the Source can be created as usual:

```scala
implicit val _ =
ExecutionContext.fromExecutorService(Executors.newFixedThreadPool(1000))

KinesisWorkerSource(builder, workerSourceSettings).to(Sink.ignore)
```

Expand Down

0 comments on commit 2d1e8b1

Please sign in to comment.