Packages
@loop-engine/adapter-kafka
@loop-engine/adapter-kafka implements the runtime EventBus interface on top of a Kafka-like producer/consumer client.
Install
1npm install @loop-engine/adapter-kafka kafkajsEvent bus factory
1kafkaEventBus(options: {2 kafka: KafkaLike3 topic: string4 groupId?: string5}): EventBusemit()sends serializedLoopEventpayloads tooptions.topic.subscribe()starts a consumer withgroupId(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" })Topic strategy
Use one topic per environment or domain boundary to keep replay and retention policies explicit.