Giter VIP home page Giter VIP logo

akka-persistence-kafka's Introduction

akka-persistence-kafka

CircleCI Maven Central Scaladoc License

akka-persistence-kafka writes journal and snapshot entries to Kafka.

Features

Supported versions:

  • Java: 1.8+
  • Scala: 2.11.x or 2.12.x or 2.13.x
  • Akka: 2.5.x(Scala 2.11 only), 2.6.x(Scala 2.12, 2.13)
  • Kafka 2.4.x+
  • Alpakka-Kafka 2.0.x+.

Installation

Add the following to your sbt build (2.11.x, 2.12.x, 2.13.x):

resolvers += "Sonatype OSS Release Repository" at "https://oss.sonatype.org/content/repositories/releases/"

val version = "..."

libraryDependencies += Seq(
  "com.github.j5ik2o" %% "akka-persistence-kafka" % version
)

Configration

The minimum necessary settings are as follows.

# if use journal plugin
akka.persistence.journal.plugin = "j5ik2o.kafka-journal"
# if use snapshot plugin
akka.persistence.snapshot-store.plugin = "j5ik2o.kafka-snapshot-store"

j5ik2o {
  kafka-journal {
    topic-prefix = "journal-"
    # if need customize, default is persistence-id
    topic-resolver-class-name = "com.github.j5ik2o.akka.persistence.kafka.resolver.KafkaTopicResolver$PersistenceId"
    # if need customize, default is partion 0
    partition-resolver-class-name = "com.github.j5ik2o.akka.persistence.kafka.resolver.KafkaPartitionResolver$PartitionZero"
   
    producer {
      kafka-clients {
        bootstrap.servers = "localhost:6001"
      }
    } 
    consumer {
      kafka-clients {
        bootstrap.servers = "localhost:6001"
        group.id = "akka-persistence-journal"
      }
    }
  }

  kafka-snapshot-store {
    topic-prefix = "snapshot-"
    # if need customize, default is persistence-id
    topic-resolver-class-name = "com.github.j5ik2o.akka.persistence.kafka.resolver.KafkaTopicResolver$PersistenceId"
    # if need customize, default is partition 0
    partition-resolver-class-name = "com.github.j5ik2o.akka.persistence.kafka.resolver.KafkaPartitionResolver$PartitionZero"

    producer {
      kafka-clients {
        bootstrap.servers = "localhost:6001"
      }
    } 
    consumer {
      kafka-clients {
        bootstrap.servers = "localhost:6001"
        group.id = "akka-persistence-snapshot"
      }
    }
  }
}

akka-persistence-kafka's People

Contributors

j5ik2o avatar scala-steward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.