Skip to content

mattwahner/confluent-schema-registry

This branch is 2 commits ahead of, 193 commits behind kafkajs/confluent-schema-registry:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e16f329 · May 27, 2021
Aug 19, 2019
May 20, 2021
May 10, 2021
Sep 13, 2019
May 27, 2021
Feb 28, 2021
Aug 29, 2019
Sep 12, 2019
Feb 24, 2021
Feb 16, 2021
Aug 19, 2019
May 20, 2021
Mar 7, 2020
Aug 19, 2019
Jan 22, 2020
Mar 18, 2020
Feb 24, 2021
Feb 24, 2021
Apr 12, 2020
Feb 9, 2021
May 20, 2021
Sep 12, 2019
Feb 14, 2021

Repository files navigation

confluent-schema-registry

@kafkajs/confluent-schema-registry is a library that makes it easier to interact with the Confluent schema registry, it provides convenient methods to encode, decode and register new schemas using the Apache Avro serialization format and Confluent's wire format.

Build Status

Getting started

npm install @kafkajs/confluent-schema-registry
# yarn add @kafkajs/confluent-schema-registry
const { Kafka } = require('kafkajs')
const { SchemaRegistry } = require('@kafkajs/confluent-schema-registry')

const kafka = new Kafka({ clientId: 'my-app', brokers: ['kafka1:9092'] })
const registry = new SchemaRegistry({ host: 'http://registry:8081/' })
const consumer = kafka.consumer({ groupId: 'test-group' })

const run = async () => {
  await consumer.connect()
  await consumer.subscribe({ topic: 'test-topic', fromBeginning: true })

  await consumer.run({
    eachMessage: async ({ topic, partition, message }) => {
      const decodedKey = await registry.decode(message.key)
      const decodedValue = await registry.decode(message.value)
      console.log({ decodedKey, decodedValue })
    },
  })
}

run().catch(console.error)

Documentation

Learn more about using KafkaJS Confluent Schema registry on the official site!

License

See LICENSE for more details.

About

is a library that makes it easier to interact with the Confluent schema registry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 81.7%
  • JavaScript 17.1%
  • Other 1.2%