confluentinc / schema-registry

Confluent Schema Registry for Kafka
https://docs.confluent.io/current/schema-registry/docs/index.html
Other
2.2k stars 1.11k forks source link

Use JSON schema from class path issue #2621

Open patpatpat123 opened 1 year ago

patpatpat123 commented 1 year ago

Hello team,

First of all, big thanks for this project. We are trying out Confluence before purchase and are stuck with an issue.

Our program is a very simple Kafka Consumer + Producer. From the input topic, we get a string, and the app will make a transformation to a JSON and then resend it back to Kafka.

Therefore, we are using the Confluence JSON, and added the confluence json serializer in the producer config. However, it seems it requires us some kind of server.

Our schema is a fixed schema, with no versioning, which is in the resource folder of our app. We just simply want to use it. However, Confluence seems to require some kind of full-blown server.

May I ask how to tell confluence our schema is in our classpath?

Thank you

OneCricketeer commented 1 year ago
  1. Confluent is a company, Confluence is a wiki software. The Schema Registry is a standalone source-available product, not required for purchase.
  2. Yes, configuring KafkaJsonSchemaSerializer requires Schema Registry HTTP(S) endpoint. It doesn't matter if your data is static (for now), or where your schema file exists. https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/serdes-json.html
  3. You don't need a Schema Registry to use JSON with Kafka. You can use StringSerializer and pre-encode your data using JSON libraries such as Jackson, for example.