use of java.time.Duration.ofSeconds in project kafka by apache.
the class InternalTopicIntegrationTest method shouldGetToRunningWithWindowedTableInFKJ.
/*
* This test just ensures that that the assignor does not get stuck during partition number resolution
* for internal repartition topics. See KAFKA-10689
*/
@Test
public void shouldGetToRunningWithWindowedTableInFKJ() throws Exception {
final String appID = APP_ID + "-windowed-FKJ";
streamsProp.put(StreamsConfig.APPLICATION_ID_CONFIG, appID);
final StreamsBuilder streamsBuilder = new StreamsBuilder();
final KStream<String, String> inputTopic = streamsBuilder.stream(DEFAULT_INPUT_TOPIC);
final KTable<String, String> inputTable = streamsBuilder.table(DEFAULT_INPUT_TABLE_TOPIC);
inputTopic.groupBy((k, v) -> k, Grouped.with("GroupName", Serdes.String(), Serdes.String())).windowedBy(TimeWindows.of(Duration.ofMinutes(10))).aggregate(() -> "", (k, v, a) -> a + k).leftJoin(inputTable, v -> v, (x, y) -> x + y);
final KafkaStreams streams = new KafkaStreams(streamsBuilder.build(), streamsProp);
startApplicationAndWaitUntilRunning(singletonList(streams), Duration.ofSeconds(60));
}
Aggregations