Commit Graph

63 Commits

Author SHA1 Message Date
Steven Gantz
12117c6049 Add additional test and error handling
Handle when functionToInvoke returns null

add link to issue

Signed-off-by: Steven Gantz <steven.p.gantz@gmail.com>
2025-02-11 16:52:07 +01:00
Agustino Lim
a88c34fc9f GH-3033: Register ObservationRegistry for Dynamic MessageChannels
Fixes: gh-3033

* ensure `ObservationRegistry` is registered on dynamically created `MessageChannel` instances in `StreamBridge`
2024-12-04 13:13:20 +01:00
Ömer Çelik
dccf8ae16a Message Channel should be closed in specified cases : application shutdown, unbinding or exceeding cache size.
checkstyle fixes

Resolves #2869
Resolves #3026
2024-11-18 14:07:48 +01:00
Soby Chacko
e14bc1cb51 Revert "Adding Spring Cloud Stream Version To Message Headers For Easier Debugging Of Issues."
This reverts commit a8fb34db0e.
2024-11-05 16:50:08 -05:00
Ömer Çelik
a8fb34db0e Adding Spring Cloud Stream Version To Message Headers For Easier Debugging Of Issues.
Fix checkstyles
Resolves #3027
2024-11-05 12:50:19 +01:00
Oleg Zhurakousky
12468dcd0a Fix checkstyles 2024-10-21 17:57:07 +02:00
Oleg Zhurakousky
2f4ae47276 GH-3009 Add post processing support for Supplier
Resolves #3009
2024-09-26 14:10:04 +02:00
Soby Chacko
4df2e760b9 Fixing failing tests
Mostly related to this commit in spring-cloud-funtion:
85a4fffcd4
2024-09-10 15:54:25 -04:00
Théophane Charbonnier
a64a6e53e1 Avoid duplicate error logging when multiple destinations per binding 2024-09-05 10:04:13 +02:00
Ömer Çelik
98501d7535 Missing Headers Problem 2024-08-02 01:06:04 +03:00
Ömer Çelik
1a0d6d3246 Missing Headers Problem 2024-08-02 00:56:02 +03:00
Oleg Zhurakousky
f356599503 GH-1163-function
Added test for the fix provided in s-c-function
2024-07-17 17:20:32 +02:00
Oleg Zhurakousky
07e7d81e2d GH-2971 Properly handle Kafka tombstone payload conversion
See the corresponding commit in s-c-function
Resolves #2971
2024-07-17 16:19:12 +02:00
Soby Chacko
4b2810f49a Fixing checkstyle issues 2024-06-18 19:08:56 -04:00
Théophane Charbonnier
2a5938e0fe GH-2961 : failing test for Header scst_partition randomly ommitted 2024-06-18 19:03:40 -04:00
Soby Chacko
fd9fa80055 Test cleanup
* Use `EnableAutoConfiguration` instead of `SpringBootApplication` in tests
2024-05-16 15:28:54 -04:00
kutmk
1f41055917 Add @EnableTestBinder annotation (#2947)
* Add @EnableTestBinder annotation
* Use @EnableTestBinder in tests
* Update copyright and author tag
* Add javadoc
* Update explanation to use @EnableTestBinder

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2931
2024-05-13 11:29:00 -04:00
Oleg Zhurakousky
ee3faf605a GH-2946 Remove spring.binders from TestBinder
Resolves #2946
2024-05-08 18:28:14 +02:00
Soby Chacko
7845be50ef GH-2932: Sanitize sensitive data on bindings endpoint
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2932

Spring Boot provides `SanitizingFunction` to allow the applicaitons to clear out
sensitive data when using certain actuator endpoints. This feature can be
extended to custom endpoints as well. Enable the bindings actuator endpoint
to sanitze sensitive data based on user-provided logic in `SantizingFuction`
beans in the application.
2024-04-17 17:30:28 -04:00
Soby Chacko
9190e9b835 GH-2921: Output-bindings and RabbitMQ r-k-e issues
* When output-bindings config is explicitly used for StreamBridge
  and the RabbitMQ routing-key-expression is provided, Spring Cloud Stream
  is throwing an exception due to a proper function is not found in
  the catalog. Bypassing this step and letting the bootstrapping continues
  if output-bindings and RabbitMQ routing-key-expression combination is used.
* Adding tests to verify

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2921
2024-03-20 16:14:16 -04:00
Soby Chacko
03a300b6c6 Cleanup in FunctionBatchingTests 2024-02-23 11:07:56 -05:00
Soby Chacko
1cda3acb22 GH-2883: CCE from custom error channel bean
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2883

When an applicaiton provides a custom errorChannel bean that is not of type
`PublishSubscribeChannel`, the application fails to start with a CCE. This is
because `BindingServiceConfiguration` uses a hard cast on `PublishSubscribeChannel`
without pre-checking the channel type. Fixing this issue.
2024-01-22 17:22:21 -05:00
Soby Chacko
c72c548763 GH-2885: Channel used by StreamBridge missing name
Fixes https://github.com/spring-cloud/spring-cloud-stream/issues/2885

The `DirectWithAttributesChannel` used by `StreamBridge` is missing naming
information. Adding the proper application context and component name data
to the channel so that it is able to construct a name when queried.
2024-01-19 15:47:54 -05:00
Oleg Zhurakousky
116813d1bb Add test for empty JSON 2023-11-30 19:01:00 +01:00
Soby Chacko
06af5ceeb0 GH-2848: Partitioning issues in StreamBridge
- When output-bindings property is explicitly provided and native-encoding
   is used, StreamBridge does not add the partitioning interceptor.
   This commit addresses this issue.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2848
2023-11-20 13:32:59 +01:00
Soby Chacko
9ebae77b1c Test cleanup in spring-cloud-stream continued
- Remove the test name prefix from the test methods in core
   spring-cloud-stream-integration-tests module

 Part of fixing https://github.com/spring-cloud/spring-cloud-stream/issues/2371.
2023-11-08 12:17:45 -05:00
Soby Chacko
74c9e4ab80 Package protected tests in core modules 2023-11-02 14:50:10 -04:00
kurt
6af320626e StreamBridge's dynamic destinations should be closed on shutdown.
- if not, we might lose some messages on shutdown especially in case of kafka async mode producing.

Resolves #2835
2023-10-20 16:03:50 +02:00
Soby Chacko
0133a95ebd StreamBridge tests cleanup 2023-10-18 12:32:07 -04:00
Soby Chacko
5a0183fd0d GH-2815: StreamBridge partitioning fixes
- When native encoding is used, StreamBridge is not setting
   partitioning interceptor which calls the PartitionHandler.
   This is a regression issue and adding the interceptor explicitly
   when native encoding is used.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2815
Resolves #2831
2023-10-18 15:06:20 +02:00
Soby Chacko
db5b717fc4 StreamBridge test cleanup
- Fix a race condtion that causes a CI failure
2023-09-28 15:35:46 -04:00
Oleg Zhurakousky
a74b3d5e99 Disabled few tests temporarily to get clean GH actions build 2023-09-28 16:55:24 +02:00
Soby Chacko
7e7688ce1b GH-2805: StreamBridge send and custom content-type
- When StreamBridge#send is called with binder-name and custom content-type,
   it does not honor the content-type value, but default to application/json.
   Fixing this issue for this call path by explicitly checking for any custom
   content-type provided on the binding.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2805
Resolves #2813
2023-09-20 13:09:51 +02:00
Oleg Zhurakousky
b4e976f371 GH-2783 Ensure proper cashing of StreamBridge function
Resolves #2783
2023-08-09 15:58:47 +02:00
Soby Chacko
50c461fb30 Fix test for the second binding in the previous commit
Resolves #2772
Resooves #2770
2023-07-17 13:29:22 +02:00
Soby Chacko
b83b2c6aa4 GH-2770: sendto header and key extraction
When sendto header is used for dynamic destinations
and a partition key extractor is given for binder based
partitioning, then the partition key extractor is not invoked
when publishing the message. Addressing this issue.

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2770
2023-07-17 13:01:35 +02: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
Oleg Zhurakousky
2b95f26d64 Polishing previous PR
Resolves #2748
2023-06-07 14:06:27 +02:00
Ivan Shapoval
8d99e80e87 Fix for function auto-detection when input/output-bindings are defined 2023-06-07 10:10:44 +02:00
Oleg Zhurakousky
1e5b41cfee GH-SCF-1045 Fix type discovery in DefaultPollableMessageSource 2023-06-06 09:54:28 +02:00
Soby Chacko
4f6361c6c4 Troubleshooting CI test failures 2023-06-02 12:06:57 -04:00
Soby Chacko
1b3fc7074b Reactive Kafka Binder errors when concurrency > 1 (#2734)
* Reactive Kafka Binder errors when concurrency > 1

When using Reactive Kafka binder, it is allowed to have concurrency > 1.
There is a check in FunctionConfiguration that throws an error if concurrency
is > 1, when using reactive types. Since it is allowed to do so with
Reative Kafka binder, switch this conversion into a warning log message.

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

* Update core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function/FunctionConfiguration.java

Co-authored-by: Gary Russell <grussell@vmware.com>

* Update core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function/FunctionConfiguration.java

Co-authored-by: Gary Russell <grussell@vmware.com>

* Update core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/function/ImplicitFunctionBindingTests.java

Co-authored-by: Gary Russell <grussell@vmware.com>

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-05-15 16:09:45 -04:00
Soby Chacko
33486848da Verifying binder name/type on bindings endpoint
Adding tests for https://github.com/spring-cloud/spring-cloud-stream/issues/2716
2023-04-20 14:45:48 -04:00
Oleg Zhurakousky
3c29149a14 GH-2707 Add support for function post processing 2023-04-13 13:53:06 +02:00
Oleg Zhurakousky
948dd2a38a GH-2664 Add support for displaying binder name/type
Resolves #2664

GH-2664 polishing
2023-03-27 09:08:13 +02:00
Soby Chacko
3aa517f11d BiConsumer creates an output binding
Currently, when the user provides a BiConsumer, the framework
creates an output binding and subsequently a target destination
on the middleware. This is unncessary and causes issues for the
application. This commit addresses this issue.

This commit requires changes from the following PR in Spring Cloud Function:
https://github.com/spring-cloud/spring-cloud-function/pull/1016

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2670
Resolves #2676
2023-03-24 11:17:54 +01:00
Oleg Zhurakousky
98051a0a1e GH-2674 Cleanup deprecated and obsolete properties in StreamFunctionProperties
Resolves #2674
2023-03-21 13:41:36 +01:00
Fernando Blanch
807f51f175 Support pause/resume for consumer bindings with multiple destinations from BindingsLifecycleController
add test queryng a binding that not exists return empty list

remove unnecessary formatting changes

Resolves #2660
Resolves #2658
2023-03-01 13:33:22 +01:00
Byungjun You
7895025c47 Use 'instanceof' pattern variable
Update authors and copyright years

Fixing checkstyle issue
2023-01-26 11:30:04 -05:00
abilan
64aef347e4 Add BindingService.get*Binding(s)(String) API
There are some use-cases when we need to know upfront
if specific binding is really bound.
The goal is to prevent some security vulnerabilities
when too many unexpected dynamic bindings, e.g.
via router based on the `StreamBridge`.
The `BindingService` provides for us `getProducerBindingNames()`
 and `getConsumerBindingNames()` which are not optimal
 for the task to check for binding presence

* Introduce `BindingService.getProducerBinding(String bindingName)`
and `getConsumerBindings(String bindingName)` to cover a use-case
when we need to check for predefined bindings.
This API might be useful in other use-case when we need to get
access to managed bindings

Related to: https://github.com/spring-cloud/stream-applications/issues/330
2023-01-23 15:19:04 +01:00