This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "hostInfo":{ | |
| "host":"1.2.3.4", | |
| "port":42 | |
| }, | |
| "stateStoreNames":[ | |
| "totalVisitCount", | |
| "hourlyVisitCount", | |
| "sessionVisitCount" | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| KStreamBuilder builder = new KStreamBuilder(); | |
| KStream<String, Long> visitsStream = builder.stream(Serdes.String(), Serdes.Long(), "visitsTopic"); | |
| KGroupedStream<String, Long> groupedStream = visitsStream.groupByKey(); | |
| KTable<String, Long> totalCount = groupedStream.count("totalVisitCount"); | |
| KTable<Windowed<String>, Long> windowedCount = groupedStream.count(TimeWindows.of(60 * 60 * 1000), "hourlyVisitCount"); | |
| groupedStream.count(SessionWindows.with(60 * 1000), "sessionVisitCount"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package de.ftrossbach.meetup | |
| import java.util.concurrent.TimeUnit | |
| import akka.actor.ActorSystem | |
| import akka.{Done, NotUsed} | |
| import akka.http.scaladsl.Http | |
| import akka.stream.ActorMaterializer | |
| import akka.stream.scaladsl._ | |
| import akka.http.scaladsl.model._ |
NewerOlder