The text is actually correct, so perhaps the graph is misleading. Each box on the consumer timeline contains 500 events, which is the supplied 1000 events broken in two batches. Does that make sense? Maybe I should clarify that the box represents a batch, not “total received”? What do you think?
Huh, how interesting. Perhaps my understanding is flawed then.
I was under the impression with a 1000 max and 500 min that an initial request for 1000 would be send to Producer. It would respond with those 1000 events which the consumer would split into batches of 500 and start processing.
Then the Consumer would request an additional 500 events once the first batch of 500 was complete.
Yes, that’s correct. And handle_events/3 will be called with each batch. Therefore, you get a list of 500 events, first, and then the remaining 500. After the second batch of 500, all 1000 events will be processed.
Ok got it. I think the confusion was in the distinction between sending 1000 events from the producer initially, but only getting the 500 in the handle_events/3 function at a time.
No problem at all, I took a note to go through this section of the book again. Maybe I can improve it to make it a bit easier. Thanks for your feedback!