Skip to content

About

An http4s client for Karapace 🐢

Topics

Resources

Stars

4 stars

Watchers

3 watching

Forks

Repository files navigation

🐢 http4s-karapace

Provides an http4s client for the Karapace schema registry.

Usage

You can add the following line to build.sbt to use the library.

libraryDependencies += "com.magine" %% "http4s-karapace" % http4sKarapaceVersion

Make sure to replace http4sKarapaceVersion with a release version.
Replace %% with %%% if you are using Scala.js or Scala Native.

Quick Example

Create a SchemaRegistryClient and use it to interact with a schema registry.

import cats.effect.IO
import cats.effect.IOApp
import cats.syntax.all._
import com.magine.http4s.karapace.SchemaRegistryClient
import com.magine.http4s.karapace.SubjectName
import org.http4s.ember.client.EmberClientBuilder
import org.http4s.syntax.all._

object Main extends IOApp.Simple {
  override def run: IO[Unit] =
    EmberClientBuilder.default[IO].build.use { client =>
      for {
        schemaRegistryClient <- SchemaRegistryClient
          .builder(client, uri"http://localhost:8081")
          .withBasicAuth("username", "password")
          .build
        name = SubjectName("topic-value")
        subject <- schemaRegistryClient.getSubject(name)
        _ <- IO.println(subject)
      } yield ()
    }
}

License

Copyright 2025 Magine Pro
Copyright 2026 Viktor Rudebeck

Licensed under the Apache License, Version 2.0.
Created by Viktor Rudebeck at Magine Pro and independently maintained since 2026.

About

An http4s client for Karapace 🐢

Topics

Resources

Stars

4 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages