@noddde/kafka
v0.3.9
Published
Kafka EventBus adapter for noddde
Maintainers
Readme
@noddde/kafka
Kafka event bus adapter for noddde. Provides scalable event streaming with consumer groups, partition-based ordering, and at-least-once delivery guarantees.
Install
yarn add @noddde/kafka kafkajs
# or
npm install @noddde/kafka kafkajsWhat's Inside
KafkaEventBus— Topic-based event publishing with consumer group fan-out, manual offset commits, configurable partition key strategy, and delivery retry tracking- Partition key defaults to
aggregateIdfor ordered processing per aggregate - Session timeout and heartbeat configuration
Usage
import { KafkaEventBus } from "@noddde/kafka";
import { wireDomain } from "@noddde/engine";
const eventBus = new KafkaEventBus({
brokers: ["localhost:9092"],
clientId: "my-service",
groupId: "my-service-group",
});
await eventBus.connect();
const domain = await wireDomain(definition, {
eventBus,
});
// Clean shutdown
await eventBus.close();Configuration
const eventBus = new KafkaEventBus({
brokers: ["localhost:9092"],
clientId: "my-service",
groupId: "my-service-group",
topicPrefix: "myapp", // Optional topic namespace
sessionTimeout: 30000,
heartbeatInterval: 3000,
resilience: {
maxAttempts: 5,
initialDelayMs: 1000,
maxDelayMs: 30000,
},
});Peer Dependencies
kafkajs>= 2.0.0
Related Packages
| Package | Description |
| :------------------------------------------------------------------- | :------------------------------------------ |
| @noddde/core | Types, interfaces, and definition functions |
| @noddde/engine | Runtime engine with domain orchestration |
| @noddde/rabbitmq | RabbitMQ event bus adapter |
| @noddde/nats | NATS event bus adapter |
License
MIT
