From dc7662e17de050dd27307cd988e30f5797c06fa9 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Tue, 26 Sep 2017 15:45:33 -0400 Subject: [PATCH] Add missing documentation for windowing properties Cleanup test Fix #196 --- .../src/main/asciidoc/overview.adoc | 28 +++++++++++++++++++ ...StreamBinderWordCountIntegrationTests.java | 3 -- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/spring-cloud-stream-binder-kafka-docs/src/main/asciidoc/overview.adoc b/spring-cloud-stream-binder-kafka-docs/src/main/asciidoc/overview.adoc index 7acec12f4..0d262b840 100644 --- a/spring-cloud-stream-binder-kafka-docs/src/main/asciidoc/overview.adoc +++ b/spring-cloud-stream-binder-kafka-docs/src/main/asciidoc/overview.adoc @@ -523,6 +523,34 @@ spring.cloud.stream.kstream.bindings.output.producer.keySerde=org.apache.kafka.c spring.cloud.stream.kstream.bindings.output.producer.valueSerde=org.apache.kafka.common.serialization.Serdes$LongSerde ---- +timewindow.length:: + Many streaming applications written using Kafka Streams involve windowning operations. + If you specify this property, there is a `org.apache.kafka.streams.kstream.TimeWindows` bean automatically provided that can be autowired in applications. + This property must be prefixed with `spring.cloud.stream.kstream.`. + A bean of type `org.apache.kafka.streams.kstream.TimeWindows` is created only if this property is provided. + + Following is an example of using this property. + Values are provided in milliseconds. + +[source] +---- +spring.cloud.stream.kstream.timeWindow.length=5000 +---- + +timewindow.advanceBy:: + This property goes hand in hand with `timewindow.length` and has no effect on its own. + If you provide this property, the generated `org.apache.kafka.streams.kstream.TimeWindows` bean will automatically conatin this information. + This property must be prefixed with `spring.cloud.stream.kstream.`. + + Following is an example of using this property. + Values are provided in milliseconds. + +[source] +---- +spring.cloud.stream.kstream.timeWindow.advanceBy=1000 +---- + + [[kafka-error-channels]] == Error Channels diff --git a/spring-cloud-stream-binder-kstream/src/test/java/org/springframework/cloud/stream/binder/kstream/KStreamBinderWordCountIntegrationTests.java b/spring-cloud-stream-binder-kstream/src/test/java/org/springframework/cloud/stream/binder/kstream/KStreamBinderWordCountIntegrationTests.java index 819078124..10bfc32cf 100644 --- a/spring-cloud-stream-binder-kstream/src/test/java/org/springframework/cloud/stream/binder/kstream/KStreamBinderWordCountIntegrationTests.java +++ b/spring-cloud-stream-binder-kstream/src/test/java/org/springframework/cloud/stream/binder/kstream/KStreamBinderWordCountIntegrationTests.java @@ -39,11 +39,9 @@ import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.cloud.stream.annotation.StreamListener; import org.springframework.cloud.stream.binder.kstream.annotations.KStreamProcessor; -import org.springframework.cloud.stream.binder.kstream.config.KStreamApplicationSupportProperties; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.kafka.core.DefaultKafkaConsumerFactory; import org.springframework.kafka.core.DefaultKafkaProducerFactory; @@ -115,7 +113,6 @@ public class KStreamBinderWordCountIntegrationTests { @EnableBinding(KStreamProcessor.class) @EnableAutoConfiguration - @EnableConfigurationProperties(KStreamApplicationSupportProperties.class) public static class WordCountProcessorApplication { @Autowired