kafcache

Memcached and Redis for Kafka Streams

License

License

GroupId

GroupId

com.madewithtea
ArtifactId

ArtifactId

kafcache_2.12
Last Version

Last Version

1.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

kafcache
Memcached and Redis for Kafka Streams
Project Organization

Project Organization

com.madewithtea
Source Code Management

Source Code Management

https://github.com/jpzk/kafcache

Download kafcache_2.12

How to add to project

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

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.8
org.scalameta : mdoc_2.12 jar 1.3.1
org.apache.kafka : kafka-streams jar 2.3.0
org.apache.kafka : kafka-streams-scala_2.12 jar 2.3.0
com.github.cb372 : scalacache-memcached_2.12 jar 0.28.0
commons-codec : commons-codec jar 1.13

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.8

Project Modules

There are no modules declared in this project.

kafcache

Codacy Badge Maven Central

In-memory Kafka Streams state store backends for low latency state store lookups. In the current version only memcached is available.

Dependency

libraryDependencies += "com.madewithtea" %% "kafcache" % "1.3.0" 

Use Memcached

Memcached does not support binary keys, therefore the byte arraywill be serialized as hex string. For more information on Memcached have a look at its documentation on https://memcached.org/.

  import com.madewithtea.kafcache.MemcachedStoreSupplier

  val store = Stores
    .keyValueStoreBuilder(
      new MemcachedStoreSupplier("state-store-name", "localhost:11211"),
      Serdes.ByteArray(),
      Serdes.ByteArray()
    )
  .withLoggingEnabled(new java.util.HashMap[String, String]())

Skip recovery

The following code will initialize a state store but it will not write to it in the recovery process. Hence, the recovery is much faster than doing actual writes.

  import com.madewithtea.kafcache.MemcachedStoreSupplier

  val store = Stores
    .keyValueStoreBuilder(
      new MemcachedStoreSupplier("state-store-name", "localhost:11211", recover = false),
      Serdes.ByteArray(),
      Serdes.ByteArray()
    )
  .withLoggingEnabled(new java.util.HashMap[String, String]())

Versions

Version
1.3.0
1.2.0
1.1.0
1.0.0