Implementation of Kafka.

Medium
Company: Premium
GoogleAmazonUber

Imagine you are building a simplified, in-memory version of Kafka. This system should allow Producers to publish messages to Topics, and Consumers to subscribe to those Topics and receive those messages. We are NOT building a distributed system here. The focus is on the core messaging and subscription mechanisms, emphasizing clean object-oriented design principles. We will leave out features like persistence, replication, and partitioning for simplicity.

Think of it this way: We need a "message bus" within a single JVM. This message bus must reliably deliver messages to all subscribed consumers. This reliability, in our simplified context, means ensuring that all active consumers receive each message exactly once (within the scope of a single JVM). This is a significantly simplified view of real-world Kafka, but a useful exercise for exploring design patterns.

Requirements

Think like an Architect

Before revealing the requirements, imagine you're in the interview right now."How would you clarify the scope with your interviewer?"

Premium Content

View detailed solutions.

UNLOCK PREMIUM