quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.84k stars 2.7k forks source link

Improve Kafka Streams Guide to be more progression based #6109

Open InfoSec812 opened 4 years ago

InfoSec812 commented 4 years ago

Description Currently, the Kafka Streams guide for Quarkus jumps straight into a lot of concepts without much context. I'd like to propose (and submit a PR for) a change which shows a progression from:

  1. Start with a simple single stream use case
  2. Add a Join
  3. Add an aggregate
  4. Add TimeWindows to the aggregate
  5. Show the use of suppressed() and how that works with TimeWindows and the grace period

In addition, I would like to call out some "stumbling blocks" I recently encountered when implementing Kafka Streams using Quarkus so that there is better clarity.

Implementation ideas I would submit a PR and a "Quickstart" example project for the progression of Kafka Streams as described above. I would also highlight some things which are not clearly called out in either the Quarkus or Kafka docs (e.g. TimeWindows have a default "grace period" of 86380000ms, not documented in either place).

InfoSec812 commented 4 years ago

Tagging @gunnarmorling as requested

gunnarmorling commented 4 years ago

Hey @InfoSec812, that all sounds great to me. Agreed that the current Kafka Streams extension guide is quite dense and would benefit from a more incremental approach. If possible, I'd like if we could stick to the current example (domain) overall, but as you say, build it up more piece-meal wise and point out potential gotchas.

In terms of a quick-start, there's one accompanying the current guide (i.e. the full example).

Would be nice if this could also show different steps of evolving this; not sure what's the best way to do this, are there similar cases in other quick starts?

If you created a PR for this, that'd be awesome. Looking forward to this! In case new images are needed, you can ask @cescoffier, he kindly produced the original ones.

InfoSec812 commented 4 years ago

@gunnarmorling Since I am working on a similar PoC for a client, the weather station use case is fine. Most of my code will be very similar and can be Copy-Pasta'd to suit.

gunnarmorling commented 4 years ago

Excellent! Thanks a lot for your efforts around this, it's much appreciated.

InfoSec812 commented 4 years ago

I gotta do the work anyhow. I might as well share the knowledge and learning with the community.

gsmet commented 4 years ago

Would be nice if this could also show different steps of evolving this; not sure what's the best way to do this, are there similar cases in other quick starts?

No. The approach with the quickstarts is to provide the final solution so that the reader can compare or have a quick overlook.

rmh78 commented 4 years ago

It would be nice if the guide could also cover more aspects of interactive-queries. The current guide does only cover "fetch by id". An other important use-case is "fetch all". Which gets interesting if the service scales up because of data distribution. I'm working on a generic abstraction for such an interactive query class.

gunnarmorling commented 4 years ago

Hey @InfoSec812, did you have a chance to make any progress with reworking the Kafka Streams guide?

InfoSec812 commented 4 years ago

No, I might be able to start this week once I am back home for DeveloperWeek.