904 Commits

Author SHA1 Message Date
Soby Chacko
f4d3715317 Recycle KafkaStreams Objects
In the event Kafka Streams bindings are restarted (stop/start)
using the actuator bindings endpoints, the underlying KafkaStreams
objects are not recycled. After restarting, it still sees the previous
KafkaStreams object. Addressing this issue.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1119
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1120
2021-08-12 15:47:40 -04:00
Soby Chacko
d7907bbdcc Docs updates for Kakfa Streams skipAndContinue 2021-08-12 14:43:22 -04:00
buildmaster
9b5e735f74 Going back to snapshots 2021-07-30 15:12:01 +00:00
buildmaster
201668542b Update SNAPSHOT to 3.2.0-M1 v3.2.0-M1 2021-07-30 15:10:38 +00:00
Soby Chacko
a5f01f9d6f GH-1110: Kafka Streams state machine changes
Restore Kafka Streams error state behavior in the binder, equivalent
to Kafka Streams prior to 2.8. Starting with 2.8, users can customize
the way uncaught errors are interpreted via an UncaughtExceptionHandler
in the applicaiton. Binder now sets a default handler that shuts down
the Kafka Streams client if thre is an uncaught error.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1110
2021-07-29 13:35:08 -04:00
Soby Chacko
912c47e3ac Fix failing tests in Kafka Streams binder
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1109
2021-07-28 18:41:22 -04:00
Soby Chacko
001882de4e Upgrade versions
Spring Kafka: 2.8.0-M1
Spring Integration Kafka: 5.5.2
Kafka: 2.8.0

Ignore a few Kafka Streams binder tests temporarily.
2021-07-27 20:01:08 -04:00
Soby Chacko
54ac274ea3 GH-1085: Allow KTable binding on the outbound
At the moment, Kafka Streams binder only allows KStream bindings on the outbound.
There is a delegation mechanism in which we stil can use KStream for output binding
while allowing the applications to provide a KTable type as the function return type.

Update docs.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1085

Resolves #1105
2021-07-16 09:46:04 +02:00
Soby Chacko
80b707e5e9 Fixing Kafka binder tests.
* Adding a delay in testDlqWithNativeSerializationEnabledOnDlqProducer to avoid a race condition.
  Awaitility is used to wait for the proper condition in this test.

* In the MicroMeter registry tests, properly wait for the first message to arrive on the outbound
  so that the producer factory gets a chance to add the MicroMeter producer listener completely
  before the test assertions start.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1103
2021-07-14 18:54:16 -04:00
Soby Chacko
13474bdafb Fixing Kafka Binder tests 2021-07-13 19:39:04 -04:00
Soby Chacko
d0b4bdf438 Revert "Temporarily disabling KafkaBinderTests"
This reverts commit 0bedc606ce.
2021-07-13 15:44:28 -04:00
Soby Chacko
0bedc606ce Temporarily disabling KafkaBinderTests 2021-07-13 15:03:40 -04:00
Oleg Zhurakousky
b5cb32767b Fix POMs for 3.2 2021-07-13 16:50:01 +02:00
Oleg Zhurakousky
1a45ff797a JUnit 5 migration related to boot 2.6 2021-07-13 13:00:55 +02:00
Soby Chacko
f7537e795e Adding docs for multi binder JAAS configuration
Adding documentation for connecting to multiple Kafka clusters
with separate JAAS configuraiton from within a single application.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/944
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/874
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/924
2021-07-07 15:37:37 -04:00
Soby Chacko
7cae3aa54f GH-1096: Named components in Kafka Streams
Support KIP-307 in Kafka Streams binder where the input (source)
and output (sink) bindings are customized with user-provided names.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1096

Resolves #1098
2021-07-05 14:48:09 +02:00
Soby Chacko
5454d54faf Support Kafka Streams binder function composition
Composed function defintions can start with a `java.util.function.Function`
or `java.util.function.BiFunction` and compose with other functions or consumers.
In the case of a consumer, this needs to be the last unit in the function definition.

`java.util.function.BiConumer` is not eligibe for function composition.

The first component in the definition can be a curried function as well.

Adding tests and docs.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1088

Resolves #1091
2021-07-05 14:29:25 +02:00
Soby Chacko
4d68282937 Refactor JAAS initializer tests 2021-06-23 21:33:11 -04:00
Soby Chacko
9cf4cdc7c1 KafkaStreamsBinderBootstrapTest updates
Migrate tests from StreamListener to the functional model.
2021-06-23 18:30:56 -04:00
Soby Chacko
69a3c36db9 GH-1094: Fix JAAS initializer tests on CI
Before running the JAAS initilizer security tests, remove reference to
JAAS related  config files created previously in other tests. This is done
through clearing a system property (java.security.auth.login.config) in
the tests. Without clearing this property, these tests run into a race condition.

Fixes https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1094
2021-06-23 17:56:38 -04:00
Soby Chacko
b8be381828 Temporarily disabling Kafka Streams jaas test 2021-06-22 21:31:36 -04:00
Soby Chacko
162993dd46 Test fixes for Kafka Streams jass config tests
Provide different application id's.
2021-06-22 21:02:10 -04:00
Soby Chacko
ee3096658a GH-1092: Fix JAAS config issues (Kafka Streams)
Currently, Kafka Streams binder does not honor JAAS configuration properties.
Address this by adding the same `KafkaJaasLoginModuleInitializer` bean used in
regular Kafka binder.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1092
2021-06-22 17:16:33 -04:00
Soby Chacko
6e46054d7b Address deprecations for StreamsBuilderFactoryBeanCustomizer
StreamsBuilderFactoryBeanCustomizer is now renamed to StreamsBuilderFactoryBeanConfigurer
2021-06-08 16:56:47 -04:00
Gary Russell
7bc90c10a2 GH-1084: Add txCommitRecovered Property
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1084

Update copyrights
2021-06-02 18:01:32 -04:00
buildmaster
5adeea2acb Bumping versions to 3.1.4-SNAPSHOT after release 2021-05-26 15:50:17 +00:00
buildmaster
65664a2d4c Going back to snapshots 2021-05-26 15:50:17 +00:00
buildmaster
f5e12a29c1 Update SNAPSHOT to 3.1.3 v3.1.3 2021-05-26 15:48:31 +00:00
Soby Chacko
416580e607 Version updates 2021-05-26 10:38:33 -04:00
aleksevi
a81093734e GH-1081 Suspicious multiplication of ScheduledExecutorService in the method "bindTo" of class "KafkaBinderMetrics"
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1081

The wrong consequence from the absense of scheduler.shutdown():
1) First of all we created the pool with 1 thread.
2) After we lost the reference on it and created the pool with 2 threads.
3) But, the first pool is not yet collected by GC and now you have 3 threads together. And so on.

Each thread does nothing, but it takes system memory and takes part in the scheduling process.
After 30 topics, for example, we potentially have (30+1)*15=465 threads.
It is already serious additional load on the switching contexts and the native memory.

Removed waiting after scheduler stop request.

checkstyle fixes
2021-05-26 10:37:42 -04:00
Soby Chacko
5f4e3eebc5 Removing deprecated setAckOnError method call (#1082)
Going forward, binder will use the default ack on error settings
in Spring Kafka, which is true by default. If the applicaitons
need to change this behavior, then a custom error handler must
be provided through ListenerContainerCustomizer.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1079
2021-05-24 16:46:26 -04:00
Taras Danylchuk
cb42e80dac gh-1059 : Added health indicator for kafka messages listener containers created via kafka binder
renamed variables, return unknown on empty listener list

added tests, fixed PR comments

checkstyle fix
2021-05-17 15:20:23 -04:00
Soby Chacko
4fb5037fd7 Use dlqProducerProperties for DLQ topics
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1077
2021-05-14 11:54:01 -04:00
Soby Chacko
d8b8c8d9fd Resetting offsets docs clarification 2021-05-06 18:16:47 -04:00
Soby Chacko
9e4a1075d4 Native compilation changes for Kafka Streams binder
This comnmit effectively removes changes introduced by a4ad9e2c0b.
Removing spring.factories mechanism of registering binders in preference to using spring.binders.
2021-04-29 19:35:15 -04:00
Soby Chacko
79497ad264 Native compilation changes
This commit effectively reverts 4e6881830a

Remove spring.factories changes introduced in the commit mentiond above.
Revert the binder to use spring.binders mechanism to register binder configurations.
2021-04-29 19:08:01 -04:00
Oleg Zhurakousky
7e48afa005 Merge pull request #1067 from sobychacko/kafka-streams-native-1
Native changes required by Kafka Streams binder
2021-04-28 19:13:52 +02:00
Oleg Zhurakousky
87ac491230 Merge pull request #1066 from sobychacko/kafka-binder-native-1
More changes required for native compilation
2021-04-28 19:13:43 +02:00
Soby Chacko
a4ad9e2c0b Native changes required by Kafka Streams binder 2021-04-28 12:26:53 -04:00
Soby Chacko
4e6881830a More changes required for native compilation
These are Kafka binder changes required for native applications.
2021-04-28 12:22:51 -04:00
Soby Chacko
829ce1cf7e Native compilation changes
This commit is a counter part to the commit below in core:

ae017e222f
2021-04-22 11:35:08 -04:00
buildmaster
c5289589c1 Bumping versions 2021-03-27 08:52:52 +00:00
Soby Chacko
dd607627ed Fix destination as pattern issues in Kafka Streams (#1054)
When destination-is-pattern property is enabled and native deserialization
is used, then Kafka Streams binder does not use the correct Serde types.
Fixing this issue by providing the proper Serdes to the StreamsBuilder.

Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1051
2021-03-25 16:20:33 -04:00
Gary Russell
0ea4315af8 GH-1043: Support Custom BatchMessageConverter
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1043
2021-03-24 13:23:53 -04:00
Soby Chacko
f25dbff2b7 Kafka Streams component bean scanning enhancements
When functional beans are discovered from libraries in the classpath,
it causes issues when Kafka Streams functions are scanned and bootstrapped.
Binder expects the users to provide function definition property although the
application does not directly include these functional beans or is aware of it.
Fixing this issue by excluding non kafka streams function from scanning.

Null check around adding micrometer listener to the StreamsBuilder.

Addressing issues raised by the comments here:
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1030#issuecomment-804039087
2021-03-22 19:06:07 -04:00
Gary Russell
f8b290844b GH-1046: Fix Out of Order Offset Commit with DLQ
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1046

When using ack mode `MANUAL_IMMEDIATE`, we must acknowledge the delivery on
the container thread, otherwise the commit will be queued for later processing,
possibly causing out of order commits, incorrectly reducing the committed offset.

Wait for the send to complete before acknowledging; use a timeout slightly larger
than the configured producer delivery timeout to avoid premature timeouts.

Tested with user-provided test case.

Fix missing timeout buffer.

More context for this issue: https://gitter.im/spring-cloud/spring-cloud-stream?at=6050f43595e23446e43cacd1
2021-03-19 15:36:29 -04:00
Gary Russell
a7e025794c Fix typo in doc 2021-03-18 13:29:21 -04:00
Gary Russell
634a73c9ff Doc Polishing for resetOffsets (#1045)
* Doc Polishing for resetOffsets

* Fix typos.
2021-03-18 13:13:18 -04:00
buildmaster
bc2f692964 Bumping versions to 3.1.3-SNAPSHOT after release 2021-03-16 13:53:15 +00:00
buildmaster
7eefe6c567 Going back to snapshots 2021-03-16 13:53:15 +00:00