spring-cloud / spring-cloud-stream-binder-kafka

Spring Cloud Stream binders for Apache Kafka and Kafka Streams
Apache License 2.0
331 stars 301 forks source link

Explore function composition options in Kafka Streams binder #1088

Closed sobychacko closed 3 years ago

sobychacko commented 3 years ago

If I have two functions of the form,

@Bean
public Function<KStream<String, String>, KTable<String, String>> process() {
}

and

@Bean
public Function<KTable<String, String>, KStream<String, String>> anotherProcess() {
}

Then it should be possible to compose them using the syntax process|anotherProcess. If the business logic inside a single function is complex and harder to read/understand, then that single function can be split into multiple ones and composed to be tested individually and may be reused. `