0

I am doing a kaafka assignment and the task is to generate random messages by players for given seasons/rounds/game.

There is a consumer which listens to all these messages and will keep track of the scoring logic. Once the scoring is done, it will publish the score to a final topic.

Now the question i am getting confuse at is how does my score calculator would know that ALL scores from players have been received before publishing the final score?

Em Ae
  • 8,167
  • 27
  • 95
  • 162

1 Answers1

1

That's the fun of unbounded data…it's unbounded :-) That is, there is not really the concept of "all data" having been received.

You'd need to build some kind of logic into your application that either decides after a certain amount of time with no more data it is complete, or the application that emits the data sends some kind of "end of feed" message/watermark to indicate that what has been read by the consumer can be processed.

Robin Moffatt
  • 30,382
  • 3
  • 65
  • 92
  • yeah. thats what i ended up doing. the final listener expects `X` number of messages and once those are done, it starts further processing. – Em Ae Jun 13 '18 at 13:27