kpl-scala


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

io.github.streetcontxt
ArtifactId

ArtifactId

kpl-scala_2.12
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

kpl-scala
kpl-scala
Project URL

Project URL

https://github.com/streetcontxt/kcl-akka-stream
Project Organization

Project Organization

io.github.streetcontxt
Source Code Management

Source Code Management

https://github.com/StreetContxt/kpl-scala

Download kpl-scala_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.streetcontxt/kpl-scala_2.12/ -->
<dependency>
    <groupId>io.github.streetcontxt</groupId>
    <artifactId>kpl-scala_2.12</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.streetcontxt/kpl-scala_2.12/
implementation 'io.github.streetcontxt:kpl-scala_2.12:2.0.0'
// https://jarcasting.com/artifacts/io.github.streetcontxt/kpl-scala_2.12/
implementation ("io.github.streetcontxt:kpl-scala_2.12:2.0.0")
'io.github.streetcontxt:kpl-scala_2.12:jar:2.0.0'
<dependency org="io.github.streetcontxt" name="kpl-scala_2.12" rev="2.0.0">
  <artifact name="kpl-scala_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.streetcontxt', module='kpl-scala_2.12', version='2.0.0')
)
libraryDependencies += "io.github.streetcontxt" % "kpl-scala_2.12" % "2.0.0"
[io.github.streetcontxt/kpl-scala_2.12 "2.0.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.11
org.slf4j : slf4j-api jar 1.7.25
com.amazonaws : amazon-kinesis-producer jar 0.12.11
com.typesafe : config jar 1.3.1

Project Modules

There are no modules declared in this project.

kpl-scala

CircleCI Bintray

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.1.0"

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.

io.github.streetcontxt

Street Contxt

Street Contxt connects the sell and buying sides of institutional finance, bringing clarity to the exchange of content between the broker and their client.

Versions

Version
2.0.0