Commit Graph

221 Commits

Author SHA1 Message Date
Soby Chacko
3a52c3b3cf GH-2821: Kafka Streams branching as Component bean
- When Kafka Streams branching function is provided as a Component bean,
   there is an issue where the raw class check on the return outbound
   resolvable type cuases an NPE. Fixing this issue by adding a null check
   on the return type's raw class.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2821
2023-09-29 16:27:04 -04:00
Soby Chacko
895570fb48 Code cleanup: AbstractKafkaStreamsBinderProcessor
- Remove deprecation warnings
 - Other code cleanup
2023-09-29 15:33:09 -04:00
Soby Chacko
5ea391beb0 GH-2823: Messages routed to the wrong consumer
- When event-type routing is enabled in Kafka Streams binder
   and conurrency > 1 is used, messages are occasionally getting
   dispatched to the wrong consumer causing CCE. This is due
   to a race condition caused by a shared resource across threads.
   Fixing the issue by introducing a ThreadLocal variable.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2823
2023-09-29 10:43:43 -04:00
buildmaster
cd0e3c1a38 Going back to snapshots 2023-09-27 10:33:44 +00:00
buildmaster
ecaf757a38 Update SNAPSHOT to 4.1.0-M2 2023-09-27 10:29:34 +00:00
Soby Chacko
bca3dd5566 DltAwareProcessor improvements
- Instead of using a BiFunction as a delegate, use standard Function that takes the full record
 - Remove Supplier<Long> that was used to handle record time stamps since this is no longer needed
 - Docs cleanup
2023-09-26 21:34:22 -04:00
Chris Bono
ca2d3046b9 Remove Boot version from Pulsar binder pom.xml (#2819) 2023-09-26 09:33:44 -05:00
Chris Bono
b51e9e408b Update Pulsar binder to Spring Boot 3.2.0-M3 (#2818) 2023-09-26 09:07:20 -05:00
Oleg Zhurakousky
38ce1f79d9 Fix property value type 2023-09-26 07:09:46 +02:00
Soby Chacko
aeb88d01e9 KafkaBinderTests cleanup
- Remove deprecations
 - Other minor cleanup
2023-09-21 15:34:32 -04:00
Chris Bono
1ef65b340d Polish "GH-2806: Pulsar binder defaults properties config" 2023-09-21 10:01:40 -05:00
Soby Chacko
34aae4b62d GH-2806: Pulsar binder defaults properties config
- Ensure that the Pulsar binder default properties can be properly
   expressed via spring.cloud.stream.pulsar.default property prefix.
 - Add the binder child context bean with the name binderName_binderProducingContext
   into the parent application context so that individual beans from the binder context
   can be easily queried.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2806
2023-09-21 09:37:54 -05:00
Soby Chacko
e06d4eedfd GH-2662: Kafka binder DLQ root cause message (#2812)
- Becasue NestedRuntimeException from Spring Framework core 6.x removed
   the getMessage method that included the detailMessage with cause in it,
   the Kafka binder DLQ records no longer include the cause message.
   Fix this issue by including the cause in the exception message.

See this comment for more details:
 - https://github.com/spring-cloud/spring-cloud-stream/issues/2662#issuecomment-1722849892
This fix is based on the following Spring Kafka commit.
 - 6f585058a6

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2662
2023-09-20 11:28:13 -04:00
Chris Bono
db54f5e730 Update Pulsar binder to use new Spring Pulsar starter.
The PulsarBinder relies on the Spring Pulsar Spring Boot starter.
The starter moved out of the spring-pulsar core repo and into
Spring Boot proper. This commit updates the Pulsar binder to
use the new coordinates for the Spring Boot based starter.

* Additionally, the PulsarProperties were greatly reduced in the
  move to Spring Boot. As such, the binder exposes an extended
  set of config properties for producer/consumer (the initial
  set supported before the property reduction).
2023-09-14 10:33:06 -04:00
Soby Chacko
3c65104b1d GH-2796: Fix partition count related issues (#2807)
If a target middleware (Kafka for ex) topic has more partitions
than what is set on the partition-count producer property, the binder
never updates the original producer partition-count property to the
partition count from the middleware if it is higher than what was given
through the property. Because of this, te PartitionAwareFunctionWrapper
which evaluates and assigns the partition header in Spring Cloud Stream
does not compute the correct partition since the hash operation still
using the original partition-count from the producer binding property.
This commit is addressing this issue.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2796
2023-09-14 08:52:14 -04:00
Soby Chacko
b5f9c5093b Kafka binder RuntimeHints
- Adding missing runtime hints for Kafka binder properties

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2604
2023-09-08 18:27:24 -04:00
Soby Chacko
26597db5b0 KafkaBinderHealthIndicator Changes
- Set considerDownWhenAnyPartitionHasNoLeader to true by default

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2760
2023-09-08 14:51:17 -04:00
Soby Chacko
bec40fba89 KafkaBinderConfigurationProperties native changes
- Earlier, we had to add Autowired on KafkaBinderConfigurationProperties constructor
   as there were some issues with runtime hints generation which caused issues when
   running an app in native mode. Spring Boot fixed these issues and we can remove
   this unnecessary Autowired from the constructor.

See the following issues from Spring Boot for more details.

https://github.com/spring-projects/spring-boot/issues/34507
https://github.com/spring-projects/spring-boot/issues/35564

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2640
2023-09-07 16:54:09 -04:00
Soby Chacko
d822129d67 DltAwareProcessor enhancements
Cleaning up the code for the custom DltAwareProcessor
2023-09-06 20:36:35 -04:00
Gyurian Norbert
0949d4e145 GH-2761: Support non-CLASSPATH based certificates
If kafka truststore and keystore locations are not local files, then they
are converted to org.springframework.core.io.Resource resources, then copied
to local file system. This means that, paths can be defined as HTTP resources too.
Currently, the Kafka binder only supports CLASSPATH based resources. It would be
useful if we can support non-CLASSPATH like resources such as HTTP, so that if an
application uses config server for example to store certificates, then those will
be copied from it's HTTP endpoint to the local filesystem as Resources.

Checkstyle, documentation fixes.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2761
2023-09-05 12:58:42 -04:00
Soby Chacko
acc8b1cb92 KafkaNull Test Changes
There was a regression introduced in Spring Cloud Function where consumers
of type Consumer<Message<?>> receive null values when tombstone records
are given as KafkaNull.

See this issue for more details: https://github.com/spring-cloud/spring-cloud-function/issues/1060

Regression is addressed in Spring Cloud Function and
making the corresponding test changes in Spring Cloud Stream Kafka binder.
2023-08-30 12:38:39 -04:00
Soby Chacko
8b7accac2a Renable Pulsar binder 2023-08-29 16:37:25 -04:00
Soby Chacko
3b4e1795c3 KafkaJaasLoginModuleInitializer init changes
- Insted of unconditionally initializing KafkaJaasLoginModuleInitializer,
   only create it, if jaas properties are set properly. By creating it always,
   we unncessarily expose Java security related class requirements to the binder
   apps. For e.g. if the underlying JVM security classes change and require
   reflection, that could break AOT apps that don't use a secure Kafka cluster.
   Fixing these type of issues by creating KafkaJaasLoginModuleInitializer only if required.
2023-08-10 12:18:16 -04:00
buildmaster
6c28820e8e Going back to snapshots 2023-08-10 01:30:10 +00:00
buildmaster
4743859cd7 Update SNAPSHOT to 4.1.0-M1 2023-08-10 01:26:38 +00:00
spencergibb
76332e1e42 jenkins/releaser hacking 2023-08-09 16:08:30 -04:00
spencergibb
2380afbe1f fixes checkstyle issues 2023-08-09 15:48:56 -04:00
spencergibb
7505144fcb Ignores pulsar-binder snapshot temporarily
The module is disabled
2023-08-09 15:26:10 -04:00
spencergibb
a45a2811e0 Disables pulsar-binder temporarily 2023-08-09 15:22:10 -04:00
Soby Chacko
7905601e51 DltAwareProcessor constructor changes 2023-07-24 15:14:38 -04:00
Soby Chacko
6bb4da89ce DLTAwareProcessor (Kafka Streams binder) changes
- Optional BiConsumer for processor record recoverer
 - Optional Supplier for downstream record timestamp
2023-07-24 15:04:57 -04:00
Soby Chacko
02567b1dae Kafka Streams binder error handling
- Initial support for Kafka Streams binder runtime error handling
 - This feature is very early in it's implementation and experimental right now
2023-07-21 18:23:58 -04:00
Soby Chacko
919d3c85fc Kafka Streams binder security test changes
- Invalidate security configuration in Kafka Streams binder
   security related tests. See the previous commit for more details.
2023-07-10 15:18:01 -04:00
Soby Chacko
0f0f29cfed Kafka binder security test changes
- Before running a test, invalidate any existing JVM-wide static
   security configuration so that tests are forced to create/use
   fresh security configuration. Without this, test suites with
   multiple security tests might fail as they might overlap with
   security confugiruation from other tests.
2023-07-10 14:23:09 -04:00
Soby Chacko
2a63301efe Reactor Kafka Binder Health Indicator (#2755)
* Reactor Kafka Binder Health Indicator

 - Provide a new abstraction for general Kafka binder related HealthIndicators.
 - Refactor Kafka binder to use the new abstraction
 - Add HealthIndicator implementation for the ReactorKafkaBinder

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2752

* Addressing PR review

* Addressing PR review

* Addressing PR review
2023-06-22 13:29:43 -04:00
Soby Chacko
0dd986d0ad Initial migration of Pulsar binder
- Moving Pulsar binder from the old 4.1.x branch
2023-06-16 16:05:46 +02:00
Soby Chacko
9ac24da343 Minor refactoring to KafkaBinderHealthIndicator
- Instead of implementing HealthIndicator directlry,
   extend from AbstractHealthIndicator provided by Spring Boot.
2023-06-14 16:52:45 -04:00
Soby Chacko
63d2bd3256 Updating to 4.1.0-SNAPSHOT 2023-06-14 14:22:10 -04:00
Soby Chacko
2093cb6a99 Multi output partition issues
- When using reactive functions, partition selector strategy does not
   use the configured partition count for multiple outbounds. This is
   because we take the first configured output binding and apply it's
   partition counts on all the outbound reactive streams (Tuples).
   Addressing this issue by properly applying the correct partition handling
   per output binding.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2750
2023-06-14 17:41:22 +02:00
buildmaster
0b7d773b30 Bumping versions to 4.0.4-SNAPSHOT after release 2023-05-24 18:47:37 +00:00
buildmaster
16cf46d74f Going back to snapshots 2023-05-24 18:47:37 +00:00
buildmaster
1550366414 Update SNAPSHOT to 4.0.3 2023-05-24 18:43:23 +00:00
jamesforward
14a444885f Multiple functions in Kafka Streams binder
* Trim functionUnits so we can declare them in a multi-line fashion,
   as currently whitespace is still considered.

 * Polishing

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2742
2023-05-22 15:58:57 -04:00
Soby Chacko
0ab5dfc05a KafkaStreams Functions Detection Logic (#2738)
* KafkaStreams Functions Detection Logic

Kafka Streams functions declared in super classes are no longer
detected by the binder discovery algorithms. Fixing this issue
by properly scanning the methods from the super classes.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2737

* Addressing PR review
2023-05-22 09:34:48 -04:00
Gary Russell
ac6dd61630 GH-2729: Reactor Kafka Binder SenderResult Support (#2730)
* GH-2729: Reactor Kafka Binder SenderResult Support

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2729

Allow configuration of a `FluxMessageChannel` to receive `SenderResult`s.
Add `SenderResultMessageHandler` to consume from that channel.

Remove undocumented `sendResult` header, which has no value without the
sender result correlation metadata.

* Add integration test and polish property docs.

- result channel must be FMC for reactive binder.

* Add documentation.

* Remove SenderResultMessageHandler.
2023-05-17 16:10:20 -04:00
oliverfuehrer
29c3cd7cdd Dynamic partition improvements in Kafka binder
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2706

  - Update partition count changes in Kafka dynamically during runtime
  - Checkstyle fixes
  - PartitionHandler changes
  - Improved handling of expression with 'payload' in the logic
  - Removed getter/setter for PartitionHandler and use ReflectionUtils within Test
  - Renamed property to 'dynamicPartitionUpdatesEnabled' and improved documentation (also one line per sentence)
  - Improved/renamed test to use embeddedkafka and really test update behaviour
  - Javadoc
2023-05-09 10:14:12 -04:00
Soby Chacko
7ee3125bc7 Fixing a Kafka binder unit test failure
Latest version of Mockito (5.3.0) used in Spring Boot 3.1.0,
apparently needs the specific Collection type when capturing
values via the ArgumentCaptor. Earlier versisons didn't mandate this.
2023-05-01 18:24:15 -04:00
Gary Russell
c21da59294 GH-2709: Reactive Kafka Binder and Topic Patterns
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2709

Add support for `...destinationIsPattern` as is supported by the message channel
binder.
2023-04-18 10:16:54 -04:00
조찬형[Plasma]
d5e5699f3b Replace duplicate code with existing method
Resolves #2702
2023-04-11 14:36:54 +02:00
Gary Russell
57733739e5 GH-2673: Use Binder Admin Config with Observation
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2673

Also configure observation (if enabled) on DLQ template.
Resolves #2703
2023-04-11 14:33:42 +02:00