⚠️ This plugin is paused. It targets the legacy Go-based Resonate Server (which had--api-kafka-enableflags); those flags do not exist in the current Rust-based Resonate Server (v0.9.7+). Do not install this for use against the current server.What to use instead, today: the Kafka worker pattern — consume Kafka with
kafkajs(orconfluent-kafka-python,rdkafkafor other languages) and callresonate.beginRun(messageId, "workflow", ...)per message. Using the Kafka message ID as the Resonate promise ID gives you idempotent dispatch.Roadmap: Native
kafka://transport is fully specified and is planned for a future release; the transport section of the spec is not yet public. This plugin will be revived (or replaced) once that lands.Reference examples for the worker pattern:
@resonatehq/kafka is the official Kafka transport binding for the Resonate TypeScript SDK. It replaces the default HTTP transport, routing task invocations and resumptions through Kafka topics instead.
npm install @resonatehq/kafkaPass a Kafka transport instance when constructing Resonate:
import { type Context, Resonate } from "@resonatehq/sdk";
import { Kafka } from "@resonatehq/kafka";
const transport = new Kafka({ brokers: ["localhost:9092"] });
await transport.start();
const resonate = new Resonate({ transport });
resonate.register("foo", function* foo(ctx: Context): Generator {
return yield* ctx.rpc("bar");
});
resonate.register("bar", function bar(_ctx: Context) {
return "hello world";
});
const result = await resonate.run("foo.1", "foo");
console.log(result); // "hello world"
await resonate.stop();Before running, create the required Kafka topics:
resonate
default
Start the Resonate server with Kafka enabled:
resonate dev --api-kafka-enable --aio-kafka-enableThen run your application:
npx ts-node app.tsFull documentation: docs.resonatehq.io