embedded-kafka-schema-registry


License

License

MIT
GroupId

GroupId

io.github.embeddedkafka
ArtifactId

ArtifactId

embedded-kafka-schema-registry_2.11
Last Version

Last Version

5.4.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

embedded-kafka-schema-registry
embedded-kafka-schema-registry
Project URL

Project URL

https://github.com/embeddedkafka/embedded-kafka-schema-registry
Project Organization

Project Organization

io.github.embeddedkafka
Source Code Management

Source Code Management

https://github.com/embeddedkafka/embedded-kafka-schema-registry

Download embedded-kafka-schema-registry_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.embeddedkafka/embedded-kafka-schema-registry_2.11/ -->
<dependency>
    <groupId>io.github.embeddedkafka</groupId>
    <artifactId>embedded-kafka-schema-registry_2.11</artifactId>
    <version>5.4.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.embeddedkafka/embedded-kafka-schema-registry_2.11/
implementation 'io.github.embeddedkafka:embedded-kafka-schema-registry_2.11:5.4.1.2'
// https://jarcasting.com/artifacts/io.github.embeddedkafka/embedded-kafka-schema-registry_2.11/
implementation ("io.github.embeddedkafka:embedded-kafka-schema-registry_2.11:5.4.1.2")
'io.github.embeddedkafka:embedded-kafka-schema-registry_2.11:jar:5.4.1.2'
<dependency org="io.github.embeddedkafka" name="embedded-kafka-schema-registry_2.11" rev="5.4.1.2">
  <artifact name="embedded-kafka-schema-registry_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.embeddedkafka', module='embedded-kafka-schema-registry_2.11', version='5.4.1.2')
)
libraryDependencies += "io.github.embeddedkafka" % "embedded-kafka-schema-registry_2.11" % "5.4.1.2"
[io.github.embeddedkafka/embedded-kafka-schema-registry_2.11 "5.4.1.2"]

Dependencies

compile (5)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
io.github.embeddedkafka : embedded-kafka-streams_2.11 jar 2.4.1.1
io.confluent » kafka-avro-serializer jar 5.4.1
io.confluent » kafka-schema-registry jar 5.4.1
io.confluent » kafka-schema-registry jar 5.4.1

test (2)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.7.30
org.scalatest : scalatest_2.11 jar 3.1.1

Project Modules

There are no modules declared in this project.

embedded-kafka-schema-registry

Maven Central Build Codacy Badge Codacy Coverage Badge Scala Steward badge

A library that provides in-memory instances of both Kafka and Confluent Schema Registry to run your tests against.

Relies on the embedded-kafka library.

Version compatibility matrix

embedded-kafka-schema-registry is available on Maven Central, compiled for Scala 2.12 and 2.13.

Support for Scala 2.11 was dropped by Apache in Kafka v2.5.0.

Versions match the version of Confluent Schema Registry they're built against.

embedded-kafka-schema-registry

How to use

  • In your build.sbt file add the following resolvers:
resolvers ++= Seq(
  "confluent" at "https://packages.confluent.io/maven/",
  "jitpack" at "https://jitpack.io"
)
  • In your build.sbt file add the following dependency (replace x.x.x with the appropriate version): "io.github.embeddedkafka" %% "embedded-kafka-schema-registry" % "x.x.x" % Test
  • Have your class extend the EmbeddedKafka trait (from the net.manub.embeddedkafka.schemaregistry package).
  • Enclose the code that needs a running instance of Kafka within the withRunningKafka closure.
  • Provide an implicit EmbeddedKafkaConfigImpl (from the same package mentioned before).
class MySpec extends AnyWordSpecLike with Matchers with EmbeddedKafka {

  "runs with embedded kafka and Schema Registry" should {

    "work" in {
      implicit val config = EmbeddedKafkaConfig()

      withRunningKafka {
        // ... code goes here
      }
    }
  }
}
  • In-memory Zookeeper, Kafka, and Schema Registry will be instantiated respectively on port 6000, 6001, and 6002 and automatically shutdown at the end of the test.

embedded-kafka-schema-registry-streams

A library that builds on top of embedded-kafka-schema-registry to offer easy testing of Kafka Streams with Confluent Schema Registry.

It takes care of instantiating and starting your streams as well as closing them after running your test-case code.

How to use

  • In your build.sbt file add the following dependency (replace x.x.x with the appropriate version): "io.github.embeddedkafka" %% "embedded-kafka-schema-registry-streams" % "x.x.x" % Test
  • For most of the cases have your class extend the EmbeddedKafkaStreams trait (from the net.manub.embeddedkafka.schemaregistry.streams package). This offers both streams management and easy creation of consumers for asserting resulting messages in output/sink topics.
  • Use EmbeddedKafkaStreams.runStreams and EmbeddedKafka.withConsumer and EmbeddedKafka.withProducer. This allows you to create your own consumers of custom types as seen in the example test.
io.github.embeddedkafka

Versions

Version
5.4.1.2
5.4.1.1
5.4.1
5.4.0
5.3.2
5.3.1
5.3.0
5.2.2
5.2.1
5.2.0
5.1.2
5.1.1
5.1.0