Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kafkajs/confluent-schema-registry
is a library that makes it easier to interact with the Confluent schema registry
https://github.com/kafkajs/confluent-schema-registry
kafka nodejs npm-package schema-registry schema-registry-client
Last synced: about 24 hours ago
JSON representation
is a library that makes it easier to interact with the Confluent schema registry
- Host: GitHub
- URL: https://github.com/kafkajs/confluent-schema-registry
- Owner: kafkajs
- License: mit
- Created: 2019-08-19T12:45:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-12-21T10:24:42.000Z (13 days ago)
- Last Synced: 2024-12-25T13:33:42.000Z (9 days ago)
- Topics: kafka, nodejs, npm-package, schema-registry, schema-registry-client
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@kafkajs/confluent-schema-registry
- Size: 1010 KB
- Stars: 159
- Watchers: 9
- Forks: 103
- Open Issues: 93
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html#wire-format).
[![Build Status](https://dev.azure.com/tulios/ConfluentSchemaRegistry/_apis/build/status/kafkajs.confluent-schema-registry?branchName=master)](https://dev.azure.com/tulios/ConfluentSchemaRegistry/_build/latest?definitionId=3&branchName=master)
## Getting started
```sh
npm install @kafkajs/confluent-schema-registry
# yarn add @kafkajs/confluent-schema-registry
``````javascript
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!](https://kafkajs.github.io/confluent-schema-registry/)
## License
See [LICENSE](https://github.com/kafkajs/confluent-schema-registry/blob/master/LICENSE) for more details.