Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/kafkagosaur/mod.ts

Kafka client for Deno binding to kafka-go using WebAssembly
Latest
import * as kafkagosaur from "https://deno.land/x/kafkagosaur@v0.0.6/mod.ts";

A Kafka client for Deno built using WebAssembly.

Example reader

const kafkaGoSaur = new KafkaGoSaur();
const reader = await kafkaGoSaur.createReader({
 brokers: ["localhost:9092"],
 topic: "test-0",
});

const readMsg = await reader.readMessage();

Example writer

const kafkaGoSaur = new KafkaGoSaur();
const writer = await kafkaGoSaur.createWriter({
 broker: "localhost:9092",
 topic: "test-0",
});

const enc = new TextEncoder();
const msgs = [{ value: enc.encode("value") }];

await writer.writeMessages(msgs);