Giter Club home page Giter Club logo

kpl-scala's Introduction

kpl-scala

A lightweight Scala wrapper around Kinesis Producer Library (KPL).

The main benefit of this library is working with Scala-native Futures when interacting with KPL.

Installation

resolvers in ThisBuild += Resolver.bintrayRepo("streetcontxt", "maven")
libraryDependencies += "com.streetcontxt" %% "kpl-scala" % "1.0.5"

Usage

Here is a simple app that initializes the Kinesis producer and sends a string message.

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain
import com.amazonaws.services.kinesis.producer.KinesisProducerConfiguration
import com.contxt.kinesis.ScalaKinesisProducer
import java.nio.ByteBuffer
import scala.concurrent.Await
import scala.concurrent.duration._

object Main {
  def main(args: Array[String]): Unit = {
    val producerConfig = new KinesisProducerConfiguration()
      .setCredentialsProvider(new DefaultAWSCredentialsProviderChain)
      .setRegion("us-east-1")

    val producer = ScalaKinesisProducer("myStream", producerConfig)

    val sendFuture = producer.send(
      partitionKey = "myKey",
      data = ByteBuffer.wrap("myMessage".getBytes("UTF-8"))
    )
    Await.result(sendFuture, 10.seconds)
    Await.result(producer.shutdown(), Duration.Inf)
  }
}

Amazon Licensing Restrictions

KPL license is not compatible with open source licenses! See this discussion for more details.

As such, the licensing terms of this library is Apache 2 license PLUS whatever restrictions are imposed by the KPL license.

No Message Ordering

Kinesis producer library does not provide message ordering guarantees at a reasonable throughput, see this ticket for more details.

Integration Tests

This library is tested as part of kcl-akka-stream integration tests.

kpl-scala's People

Contributors

agenovese avatar angelo-streetcontxt avatar anikiforovopensource avatar richard-hunt avatar ukayani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.