1.3.0 • Published 2 years ago

kafka-confluent-avro v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

kafka-confluent-avro

Lightweight kafka confluent registry integration for avro runtime schema serialization and de-serialization. Implements intelligent encoding and decoding of avro schema to/from kafka messages.

Usage

import { SchemaRegistry } from 'kafka-confluent-avro';

const registry = new SchemaRegistry({ host: 'https://confluent.registry:8081' });

registry.encodeMessageByTopic(valueToEncode, 'topic');

APIs

encodeMessageByTopic

Encode a value with a latest schema for a topic. Subject for that stored schema should be the ${topic name}-value;

encodeMessageBySchemaId

Encode a value with a latest version of a schema by unique schema id.

encodeMessageByTopicSafe

Safely encode a value with some schema for a topic. If the value is invalid for the latest version of the schema, it will retry downgrading the schema to the previous version.

The process will retry for 3 previous versions, throws an error if there is no valid outcome.

decode

Decode a kafka message (buffer) with the encoded schema. If there's no schemaId encoded in the message, just returns the value of the message as is.

1.3.0

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.9

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago