* Introduce the ability to provide BiFunction beans as Kafka Streams processors.
* Bypass Spring Cloud Function catalogue for bean lookup by directly querying the bean factory.
* Add test to verify BiFunction behavior.
Resolves#690
This PR introduces some fundamental changes in the way functional model of Kafka Streams applications
are supported in the binder. For the most part, this PR is comprised of the following changes.
* Remove the usage of EnableBinding in Kafka Streams based Spring Cloud Stream applications where
a bean of type java.util.function.Function or java.util.function.Consumer is provides (instead of
a StreamListener). For StreamListener based Kafka Streams applications, EnableBinding is still
necessary and required.
* Target types (KStream, KTable, GlobalKTable) will be inferred and bound by the binder through
a new binder specific bindable proxy factory.
* By deault input bindings are named as <functionName>-input for functions with single input
and <functionName>-input-0...<functionName>-input-n for functions with n-1 number of inputs.
* By deault output bindings are named as <functionName>-output for functions with single output
and <functionName>-output-0...<functionName>-output-n for functions with n-1 number of outputs.
* If applications prefer custom input binding names, the defaults can be overridden through
spring.cloud.stream.function.inputBindings.<funcationName>. Similarly if custom outpub binding names
are needed, then that can be done through spring.cloud.streamfunction.outputBindings.<functionName>.
* Test changes
* Refactoring and polishing
Resolves#688
* Upgrade Kafaka versions used in tests.
* EmbeddedKafkaRule changes in tests.
* KafaTransactionTests changes (createProducer expectations in mockito).
* Kafka Streams bootstrap server now return an ArrayList instead of String.
Making the necessary changes in the binder to accommodate this.
* Kafka Streams state store tests - retention window changes.
* Topic provisioning for consumers ignores topic.properties settings if binding type is KTable or GlobalKTable
* Modify tests to verify the behavior during KTable/GlobalKTable bindings
* Polishing
Resolves#687
Fixes https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/677
The logic for resetting offsets only on the initial assignment used a simple
boolean; this is insufficient when concurrency is > 1.
Use a concurrent set instead to determine whether or not a particular topic/partition
has been sought.
Also, change the `initial` argument on `KafkaBindingRebalanceListener.onPartitionsAssigned()`
to be derived from a `ThreadLocal` and add javadocs about retaining the state by partition.
**backport to all supported versions** (Except `KafkaBindingRebalanceListener` which did
not exist before 2.1.x)
polishing
When using native de/serializaion (which is now the default), the binder should infer the common Serde's
used on input and output. The Serdes inferred are - Integer, Long, Short, Double, Float, String, byte[] and
Spring Kafka provided JsonSerde.
Resolves#368
Address PR review comments
Addressing PR review comments
Resolves#672
In Kafka Streams binder, use the native Serde mechanism as the default instead of the framework
provided message conversion on the input and output bindings. This is to align applications
written using Kafka Streams binder more compatible with native concepts and mechanisms.
Users can still disable native encoding and decoding through configuration.
Amend tests to accommodate the flipped configuration.
Resolves#651
Fixing a bug around when we have muliple beans defined as functions/csonumers in the new
Kafka Streams binder functional support.
Polishing
Resolves#636
Introducing the ability to provide custom state stores as regular
Spring beans and use them in the functional model of Kafka Streams binding.
Resolves#642
Fixing a bug around when we have muliple beans defined as functions/csonumers in the new
Kafka Streams binder functional support.
Polishing
Resolves#636
Filter in only Kafka streams function beans
It appears we have refactored to rename the class from `KStreamProcessor` to `KafkaStreamsProcessor` [see a5344655cb (diff-4a8582ee2d07e268f77a89c0633e42f5)], but the docs weren't updated. This commit does exactly that.
With multiplex topics, topics can be an array. Sine message listener container
bean name is created by calling a toString() on the topics, when it is an array
it creates an unusual bean name. Fixing the issue by creating the bean name by
using destination string directly.