kafka-akka-extension


License

License

Categories

Categories

Akka Container Microservices Reactive libraries
GroupId

GroupId

nl.tradecloud
ArtifactId

ArtifactId

kafka-akka-extension_2.12
Last Version

Last Version

0.64
Release Date

Release Date

Type

Type

jar
Description

Description

kafka-akka-extension
kafka-akka-extension
Project URL

Project URL

https://github.com/tradecloud/kafka-akka-extension
Project Organization

Project Organization

nl.tradecloud
Source Code Management

Source Code Management

https://github.com/tradecloud/kafka-akka-extension

Download kafka-akka-extension_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/nl.tradecloud/kafka-akka-extension_2.12/ -->
<dependency>
    <groupId>nl.tradecloud</groupId>
    <artifactId>kafka-akka-extension_2.12</artifactId>
    <version>0.64</version>
</dependency>
// https://jarcasting.com/artifacts/nl.tradecloud/kafka-akka-extension_2.12/
implementation 'nl.tradecloud:kafka-akka-extension_2.12:0.64'
// https://jarcasting.com/artifacts/nl.tradecloud/kafka-akka-extension_2.12/
implementation ("nl.tradecloud:kafka-akka-extension_2.12:0.64")
'nl.tradecloud:kafka-akka-extension_2.12:jar:0.64'
<dependency org="nl.tradecloud" name="kafka-akka-extension_2.12" rev="0.64">
  <artifact name="kafka-akka-extension_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='nl.tradecloud', module='kafka-akka-extension_2.12', version='0.64')
)
libraryDependencies += "nl.tradecloud" % "kafka-akka-extension_2.12" % "0.64"
[nl.tradecloud/kafka-akka-extension_2.12 "0.64"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.7
com.typesafe.akka : akka-stream-kafka_2.12 jar 0.22
com.typesafe.akka : akka-actor_2.12 jar 2.5.18
com.typesafe.akka : akka-remote_2.12 jar 2.5.18

test (3)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.5
com.typesafe.akka : akka-testkit_2.12 jar 2.5.18
net.manub : scalatest-embedded-kafka_2.12 jar 1.1.0

Project Modules

There are no modules declared in this project.

Kafka Akka

Build Status Maven Central License

A wrapper around Akka's reactive kafka providing resilience and re-use of Akka defined serialization for Kafka messages.

Configuration

Add the dependency in the build.sbt, like:

libraryDependencies ++= Seq(
    "nl.tradecloud" %% "akka-kafka" % "0.65"
)

Configure in the application.conf file, like:


tradecloud.kafka {
  serviceName = "test"
  brokers = "localhost:9092"
  topicPrefix = ""
  groupPrefix = ""
}

As this library is a wrapper around Akka's reactive kafka, you can also use the configuration options of Reactive Kafka.

Usage

Subscribe

implicit val system: ActorSystem = ActorSystem()
implicit val materializer: Materializer = ActorMaterializer()

new KafkaSubscriber(
    group = "some_group_name",
    topics = Set("some_topic")
  ).atLeastOnce(
    Flow[String]
      .map { wrapper: KafkaMessage[String] =>
        // do something
        println(wrapper.msg + "-world")
        
        // return the offset
        msg.offset
      }
  )

Publish

// promise is completed when publish is added to Kafka
implicit val system: ActorSystem = ActorSystem()
implicit val materializer: Materializer = ActorMaterializer()

val publisher = new KafkaPublisher()

publisher.publish("topic", msg)

Serialization

Serialization is handled using Akka Serialization, see: Akka Serialization

nl.tradecloud

tradecloud

Versions

Version
0.64
0.63
0.62
0.61
0.60
0.59
0.58
0.56
0.55
0.54
0.53
0.52.3
0.52.2
0.52.1
0.52
0.51
0.50
0.49
0.48
0.47
0.46
0.45
0.44
0.43
0.42
0.41
0.40
0.39
0.38
0.37
0.36
0.35
0.34
0.33
0.32
0.30
0.29
0.28
0.27
0.26
0.25
0.24
0.23
0.22
0.21
0.20
0.19
0.18
0.17
0.16
0.15
0.14
0.13
0.12
0.11
0.10
0.9