Design and Implement a Java producer consumer (Part 1)
7 min readApr 27, 2020
In this document, we design a simple Producer Consumer pattern in Java.
Problem statement
The Producer-Consumer pattern is used in many places in various software systems. This is a great way of decoupling separate tasks, and handle asynchronous work. Kafka is a very popular queue/stream technology that is used to push (a lot of) data from publishers to consumers efficiently.
Let’s assume we want to send messages from Earth to Mars. Because of the great distance between Earth…