Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for embedded-kafka-schema-registry to the testkit #1196

Open
bbarker opened this issue Mar 14, 2024 · 4 comments
Open

Add support for embedded-kafka-schema-registry to the testkit #1196

bbarker opened this issue Mar 14, 2024 · 4 comments

Comments

@bbarker
Copy link

bbarker commented Mar 14, 2024

I have a version of this working locally and would be happy to get a PR submitted once I kick the tires on it a bit more. But let me know of any requirements that you might want for this and if it would be a welcome addition. Currently it reflects the existing Kafka layer with very few changes, e.g. :

import _root_.kafka.server.KafkaConfig
import io.github.embeddedkafka.schemaregistry.{EmbeddedKWithSR, EmbeddedKafka, EmbeddedKafkaConfig}
import zio.*

object KafkaSchemaRegistry {

  /**
   * Creates an in-memory Kafka instance with a random port.
   */
  def embedded: ZLayer[Any, Throwable, Kafka] = embeddedWith(_ => Map.empty)

// ....
@erikvanoosten
Copy link
Collaborator

erikvanoosten commented Mar 14, 2024

Maybe the other maintainers think differently about this, but I would prefer not to mix support for Confluent's schema registry with support for Apache's Kafka in the same repository (or at least, not in the same library).

@bbarker
Copy link
Author

bbarker commented Mar 14, 2024

Maybe another testkit module that depends on the existing testkit? Then the question is would it be good to host within this repo or not (and as a submodule of the root or not).

@guizmaii
Copy link
Member

Personally, I'm ok to provide it in zio-kafka. The Confluent Schema Registry is kind of the norm in the Kafka world and, to me, it makes sense for us to provide such helper in our testkit. Happy to review any PR bringing this @bbarker.
Putting it in another module make sense to me. That can allow people to bring support of different registries by adding an sbt module per registry

@erikvanoosten
Copy link
Collaborator

Its the norm because unfortunately Confluent's Schema Registry is the best there is. Still, there are many Kafka deployments that do not use it. In addition, Confluent's libraries can only be gotten from their own maven repository. I think a separate module would save a lot of headaches for people that don't want to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants