All Projects → aserrallerios → kcl-akka-stream

aserrallerios / kcl-akka-stream

Licence: other
Custom Akka Stream Sources and Flows to interact with Kinesis streams using Kineis Client Library

Programming Languages

scala
5932 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to kcl-akka-stream

commerce-cif-api
Adobe Commerce Integration Framework (CIF) API reference and data model documentation files
Stars: ✭ 18 (-18.18%)
Mutual labels:  deprecated
code-gov-style
Deprecated - Style for code.gov including buttons, banners, and cards
Stars: ✭ 12 (-45.45%)
Mutual labels:  deprecated
microsoft-teams-faqplusplus-app
DEPRECATED - This repository contains a deprecated version of the FAQ Plus app template. Please see the README file for more details and a link to the new repository
Stars: ✭ 47 (+113.64%)
Mutual labels:  deprecated
grunt-git-ftp
DEPRECATED: queries last git commit and FTPs modified files to server
Stars: ✭ 11 (-50%)
Mutual labels:  deprecated
amazon-alexa-skill-library
DEPRECATED PHP Library for Amazon Alexa Skills
Stars: ✭ 13 (-40.91%)
Mutual labels:  deprecated
audiobug
A simple Android app to record audio through the microphone.
Stars: ✭ 19 (-13.64%)
Mutual labels:  deprecated
generator-oraclejet
DEPRECATED Yeoman generator for creating Web and Mobile-hybrid Oracle JET based applications
Stars: ✭ 13 (-40.91%)
Mutual labels:  deprecated
jQueryFileUpload.Net
[Out of Date] .Net handler for http://aquantum-demo.appspot.com/file-upload
Stars: ✭ 68 (+209.09%)
Mutual labels:  deprecated
exec-file-sync
Node.js 0.12 childProcess.execFileSync() ponyfill
Stars: ✭ 12 (-45.45%)
Mutual labels:  deprecated
twinfield
✗ [DEPRECATED] Library for using the Twinfield API
Stars: ✭ 20 (-9.09%)
Mutual labels:  deprecated
react-flex-slick
Slick carousel using Flexbox
Stars: ✭ 40 (+81.82%)
Mutual labels:  deprecated
picosdk-python-examples
DEPRECATED - An example Python application and examples for PicoScope® oscilloscope products.
Stars: ✭ 21 (-4.55%)
Mutual labels:  deprecated
react-virtual-keyboard
Use jQuery Virtual Keyboard in react.js
Stars: ✭ 44 (+100%)
Mutual labels:  deprecated
gradle-common-deps-plugin
Gradle plugin that provides convenience closure for configuring common dependencies
Stars: ✭ 22 (+0%)
Mutual labels:  deprecated
codgic-web-legacy
🐛 A free, open-source Online Judge alternative. Coding Magic.
Stars: ✭ 13 (-40.91%)
Mutual labels:  deprecated
max-safe-integer
ES2015 Number.MAX_SAFE_INTEGER ponyfill
Stars: ✭ 15 (-31.82%)
Mutual labels:  deprecated
rhscl-dockerfiles
DEPRECATED AND NOT UPDATED set of dockerfiles for various Software Collection packages.
Stars: ✭ 79 (+259.09%)
Mutual labels:  deprecated
navigation tags
Radiant Extension - navigation_tags
Stars: ✭ 20 (-9.09%)
Mutual labels:  deprecated
winnow
Deprecated
Stars: ✭ 89 (+304.55%)
Mutual labels:  deprecated
atom-remember-session
A simple package to make Atom remember your previous session - Not being developed anymore!
Stars: ✭ 15 (-31.82%)
Mutual labels:  deprecated

This library is DEPRECATED and will get no further maintenance, please use alpakka instead:

2.0.0 release notes

Akka Stream Source for Kinesis Client Library travis-badge Bintray

For more information about Kinesis please visit the official documentation.

The KCL Source can read from several shards and rebalance automatically when other Workers are started or stopped. It also handles record sequence checkpoints.

For more information about KCL please visit the official documentation.

Installation

<repository>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  <id>bintray-<username>-maven</id>
  <name>bintray</name>
  <url>https://dl.bintray.com/content/aserrallerios/maven</url>
</repository>
...
<dependency>
  <groupId>aserrallerios</groupId>
  <artifactId>kcl-akka-stream_2.11</artifactId>
  <version>0.4</version>
  <type>pom</type>
</dependency>
resolvers += "aserrallerios bintray" at "https://dl.bintray.com/content/aserrallerios/maven"
libraryDependencies += "aserrallerios" %% "kcl-akka-stream" % "0.4"

Usage

AWS KCL Worker Source & checkpointer

The KCL Worker Source needs to create and manage Worker instances in order to consume records from Kinesis Streams.

In order to use it, you need to provide a Worker builder and the Source settings:

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()}"
      )
    )
    .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:

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

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

Committing records

The KCL Worker Source publishes messages downstream that can be committed in order to mark progression of consumers by shard. This process can be done manually or using the provided checkpointer Flow/Sink.

In order to use the Flow/Sink you must provide additional checkpoint settings:

val checkpointSettings = KinesisWorkerCheckpointSettings(100, 30 seconds)

KinesisWorkerSource(builder, workerSourceSettings)
  .via(KinesisWorkerSource.checkpointRecordsFlow(checkpointSettings))
  .to(Sink.ignore)

KinesisWorkerSource(builder, workerSourceSettings).to(
  KinesisWorkerSource.checkpointRecordsSink(checkpointSettings))

Note that checkpointer Flow may not maintain input order of records of different shards.

License

Copyright (c) 2018 Albert Serrallé

This version of kcl-akka-stream is released under the Apache License, Version 2.0 (see LICENSE.txt). By downloading and using this software you agree to the End-User License Agreement (EULA).

We build on a number of third-party software tools, with the following licenses:

Java Libraries

Third-Party software License
amazon-kinesis-client Amazon Software License
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].