Skip to content

Conversation

@halilcengel
Copy link
Contributor

No description provided.

Extended the event module to support Kafka as an alternative to socket-based event handling. Added initialization, publish, and subscribe logic for Kafka, allowing events to be sent and received via Kafka topics. Refactored type definitions and updated method signatures to support both socket and Kafka backends.
Refactored event client to support both in-memory (socket.io) and Kafka backends. Added type-safe initialization options, async publish/subscribe methods, and error handling for Kafka. Introduced docker-compose for local Kafka setup and provided a Kafka usage example. Removed Jest config and legacy tests to focus on integration-based workflows.
Refactored the event system to maintain persistent Kafka producer and per-topic consumers, improving connection reuse and error handling. Added an async cleanup method to gracefully disconnect all resources, and process signal handlers for shutdown. Updated API to make init, publish, subscribe, and cleanup methods asynchronous for better reliability.
@canmingir canmingir changed the title Kafka adapter Kafka Adapter Aug 27, 2025
halilcengel and others added 3 commits August 28, 2025 11:12
Reorganized event handling logic by introducing EventAdapter interface and splitting in-memory and Kafka implementations into separate adapter classes. This improves modularity and maintainability, allowing easier extension for new event backends. The Event.ts file now delegates to the appropriate adapter based on initialization options.
Moved event adapter interfaces and implementations into a new 'adapters' directory. The event system now delegates to either InMemoryAdapter or KafkaAdapter via a unified EventAdapter interface, improving modularity and separation of concerns. Updated type imports and removed socket and kafka logic from Event.js, delegating all transport-specific logic to adapters.
Introduced a 'test' script to package.json that runs Jest on the src directory for easier testing.
@canmingir canmingir merged commit caee18f into main Aug 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants