Closed zapient closed 7 years ago
As I read the Kafka protocol, it's not supported to specify max messages on a stream, so I guess the producer would have to keep track of the demand and how many messages are streaming through, and open/close the stream accordingly.
Does this make sense to anyone? If so, I could try to make a POC for this.
@Firemango thanks for volunteering go ahead and send in a PoC
@Firemango We'll have to be very careful about how we do this. GenStage currently requires Elixir v1.3 and some folks using KafkaEx might not be prepared to upgrade. That shouldn't stop doing a PoC, we'll just have to think carefully about how to proceed if it works well.
Alright, I will get started. @dantswain I will see how the PoC goes. Maybe it won't actually depend on any kafkaex internal code and could move it to an entirely separate repo, which can be merged in at a later time to reduce juggling versions.
I am closing this issue, we will not add GenStage support to kafka_ex, it expects count of messages while kafka only supports bytes to be consumed which does not necessarily translate to a certain number of messages. There are also several ways to implement several things with GenStage that makes it difficult to implement a generic implementation that would fit into a library
http://elixir-lang.org/blog/2016/07/14/announcing-genstage/