@opra/kafka
v1.28.5
Published
Opra Kafka adapter
Readme
@opra/kafka
Standalone Kafka transport adapter for the OPRA framework
🌐 Documentation · 🚀 Getting Started · 📦 Packages · 💬 Issues
Standalone Kafka transport adapter for the OPRA framework. Define message queue operations with the same decorator-driven model used for HTTP — no separate consumer/handler boilerplate.
Features
KafkaAdapter— Platform adapter managing Kafka consumer groups and message routingKafkaContext— Per-message context with typed access to topic, key, payload, partition, and headers- Consumer group configuration with session timeouts and concurrency settings
- Seamless integration with OPRA's
@MQOperationdecorators and validation pipeline
Installation
npm install @opra/kafkaUsage
import { KafkaAdapter } from '@opra/kafka';
const adapter = new KafkaAdapter(apiDocument, {
client: {
clientId: 'my-service',
bootstrapBrokers: ['localhost:9092'],
},
consumers: {
'my-group': { sessionTimeout: 30000 },
},
});
await adapter.initialize();
await adapter.start();For NestJS integration use
@opra/nestjs-kafka.
Node Compatibility
- node >= 20.x
License
Available under MIT license.
