Packages
Loading
Loading
Packages
@loop-engine/adapter-kafka implements the runtime EventBus interface on top of a Kafka-like producer/consumer client.
1npm install @loop-engine/adapter-kafka kafkajs1kafkaEventBus(options: {2 kafka: KafkaLike3 topic: string4 groupId?: string5}): EventBusemit() sends serialized LoopEvent payloads to options.topic.subscribe() starts a consumer with groupId (default: loopengine) and forwards parsed messages to the handler.1import { Kafka } from "kafkajs"2import { kafkaEventBus } from "@loop-engine/adapter-kafka"3 4const kafka = new Kafka({ brokers: ["localhost:9092"] })5const bus = kafkaEventBus({ kafka, topic: "loop-events", groupId: "loopengine-docs" })Use one topic per environment or domain boundary to keep replay and retention policies explicit.