Commit Graph

170 Commits

Author SHA1 Message Date
Oleg Zhurakousky
2e133f9e9a Add test for FunctionAroundWrapper 2021-04-08 17:10:17 +02:00
Oleg Zhurakousky
b2f36936ac GH-662 Fix support for reactive functions in AWS
This commit also includes other minor fixes around CustomRuntime which was getting in the way of this specific issue
 Added lookup for _HANDLER env variable
 Added few tests (will need more)
 Added support for Iterable for reactive functions

Resolves #662
2021-04-08 15:57:14 +02:00
Oleg Zhurakousky
c0ed41f9c7 GH-679 Add test to validate output conversion for composed functions
Resolves #679
2021-04-07 11:53:17 +02:00
Oleg Zhurakousky
b96b834cdd GH-640 Fix NPE with non-Message json conversion
Resolves #640

Added test
2021-02-05 16:12:31 +01:00
Oleg Zhurakousky
da7f21d9e8 GH-635 Fix support for returning empty Collections
Resolves #635
2021-01-22 16:43:55 +01:00
Oleg Zhurakousky
ad1bd31ead GH-620 Add BeanResolver support for RoutingFunction
Resolves #620

polish
2021-01-22 14:52:04 +01:00
ncheema
88f2d8ed11 method already has a condition to retrieve immediateGenericType for a message
This condition was meant to be removed as part of #543

Resolves #624
2021-01-11 10:43:09 +01:00
Oleg Zhurakousky
8ece3d3083 Add stream (kafka, Rabbit) and Rsocket examples for Cloud Event 2020-12-18 16:44:29 +01:00
Oleg Zhurakousky
30febe6bce Cleaned up Cloud Event support around reactive functions
Added reactive tests
Restructured CloudEventsFunctionInvocationHelper
2020-12-11 14:34:32 +01:00
Oleg Zhurakousky
aede56dfc6 Fix Cloud Events support for Message functions
Ensured Cloud Event completness by adding assertion for required attributes as well as generation of default values for attributes such as ID and SPECVERSION
2020-12-02 18:22:17 +01:00
Oleg Zhurakousky
923d5204e4 Tidy up logic around canonicalization of attributes
Added initial test to validate builder and utils
2020-12-02 15:17:17 +01:00
Oleg Zhurakousky
753d6369a2 interim 2020-12-02 13:10:05 +01:00
Oleg Zhurakousky
523cd1023f Change canonical format of Cloud Event Message attributes to have 'ce-' prefix 2020-12-02 11:24:03 +01:00
Oleg Zhurakousky
306da4248a Restructure Cloud Events support to optionally support Cloud Events SDK 2020-12-01 22:12:34 +01:00
Oleg Zhurakousky
e2788fbab0 GH-611 Add test to ensure there is no regression
Resolves #611
2020-11-23 20:25:18 +01:00
Oleg Zhurakousky
e4242388fb GH-609 Fix support for missmatched Publishers
Given that s-c-f-web always sends input as Flux, it creates issues for Function<Mono, Mono>, so this fixes it
Resolves #609
2020-11-20 12:13:52 +01:00
Oleg Zhurakousky
e112b6c9dc GH-608 Add test to validate there is no regression
Resolves #608
2020-11-20 11:27:03 +01:00
Oleg Zhurakousky
cd2d84d382 Fix spelling errors in method name 2020-11-17 16:54:29 +01:00
Oleg Zhurakousky
53addc50c8 Add additional Cloud Event function test 2020-11-17 08:58:53 +01:00
Oleg Zhurakousky
ac54a83e09 Clean up and simplifications around CloudEvent processing
This commit effectively a merge of work with #607 and simplifies the following
- CloudEventAttributesProvider now provides CloudEventAttributes initialized with defaults to be set by the user
- In HTTP RequestProcessor the logic of sanitizing headers was improved to ensure that correct prefix is applied

Resolves #607
2020-11-16 13:40:53 +01:00
Oleg Zhurakousky
ada16079ca GH-422 GH-606 Add support for normalizing structure-mode CE message
Normalizing in this context means converting it to binary-mode so the rest of the processing logic is the same.
Added support for canonical attribute names. Now, internally any attribute can be set as 'ce_' regardless where it came from are where it goes to as the frameork will be able to recognize both
Removed CloudEventMessageConverter
Renamed CloudEventAttributes to CloudEventAttributesHelperas it is better suited to what it actually does
2020-11-16 12:06:33 +01:00
Oleg Zhurakousky
c31b7f1f20 Make CloudEventAttributesProvider a FunctionalInterface
Related to #422 and #606
2020-11-16 08:41:42 +01:00
Oleg Zhurakousky
311649c312 Fix CloudEvent prefix and fix the name of CloudEventAttributesProvider.java 2020-11-13 16:07:33 +01:00
Oleg Zhurakousky
9c58e6d64b GH-422 GH-606 Add support for simplifying message headers to attribute mapping
Added CloudEventAttributesProvider and default implementation
Added CloudEventMessageUtils
2020-11-13 10:24:27 +01:00
Oleg Zhurakousky
f999cdd787 GH-422 Formalize Cloud Event conversion strategy to consistently handle binary-mode and structured-mode cloud events
Moved CloudEvent related artifacts to ‘cloud events’ package with hopes to eventually donating it to CNCF SDK
Created CloudEventUtils identifying necessary constants and utility methods
2020-11-12 17:01:42 +01:00
Oleg Zhurakousky
a39476561a GH-422 Add RabbitMQ instructions for Cloud Events interaction 2020-11-11 11:53:39 +01:00
Oleg Zhurakousky
3cea0343df PR-605 less formatting
Resolves #605
2020-11-09 16:16:23 +01:00
Oleg Zhurakousky
8774383dc8 GH-601 add test to validate the issue is fixed
Resolves #601
2020-11-09 15:35:35 +01:00
Oleg Zhurakousky
9b325ce7e6 GH-602 Ensure collections with converted items are not converted again
Resolves #602
2020-11-09 14:07:20 +01:00
Oleg Zhurakousky
1209fa1053 Additional clean up and polishing 2020-11-04 10:43:29 +01:00
Oleg Zhurakousky
7c860eb334 Re-enable support for around advise 2020-10-26 08:29:16 +01:00
Oleg Zhurakousky
dc8d51b873 Consolidate mechanisms around retaining headers and skipping input/output conversion 2020-10-23 13:19:03 +02:00
Oleg Zhurakousky
544e35335a GH-596 Add support for handling conversion of complex types
Resolves #596
2020-10-21 14:36:50 +02:00
Oleg Zhurakousky
b8d462678a Deprecate and remove all usages of FunctionInspector 2020-10-19 18:11:11 +02:00
Oleg Zhurakousky
10b1f808ba Consolidate isMessage() operation 2020-10-19 14:57:55 +02:00
Oleg Zhurakousky
72f05fc591 Refactor FunctionCatalog implementation 2020-10-16 17:59:06 +02:00
Oleg Zhurakousky
4d49b4d6ec GH-568 Add support for casting resulting function as Runnable
Resolves #568
2020-09-21 17:22:38 +02:00
Oleg Zhurakousky
3115833c88 GH-588 Fix dropped headers during input conversion
This addresses the issue of dropped Message headers in the event where input is a Message but input conversion is not necessary
while Message contains headers that require explicit propagation (e.g., scf-sink-url, scf-func-name)

Resolves #588
2020-09-18 18:46:52 +02:00
Oleg Zhurakousky
e19ed2ff68 GH-587 Add support for inferring 'accept' content type for simple types
This fix also introduces new Function property 'accept' with no default value which implicitely would default to application/json unless the output type of the function is String at which point it would default to text/plain. However, if it was explicitely set in FunctionProperties it will be used regardless of the function output type.
Resolves #587
2020-09-16 18:14:40 +02:00
Oleg Zhurakousky
2f36dbccb3 Various polishing to accomodate boot, reactor and other changes 2020-08-04 19:21:14 +02:00
Oleg Zhurakousky
c7eae3e16f GH-550 Add support for wrapping value into Message if necessary
Resolves #550
2020-06-19 15:26:28 +02:00
anshlykov
9e5e35f700 SimpleFunctionRegistryTests: reactive function test case
FunctionTypeUtils#isTypeCollection: unwrap publisher

JsonMessageConverter: handler for a ParameterizedType conversionHint

refactor
2020-06-17 08:58:46 +02:00
Oleg Zhurakousky
c9e0801b1d GH-503 Add test to demonstrate custom message converter usage
Resolves #503
2020-06-11 15:36:27 +02:00
Oleg Zhurakousky
af192a5adf GH-531 Fail function registration for incompatible types
Given that we now can auto-discover function type from provided target object, this fix will fail function registration if provided type is not compatible (assignableFrom. . .)

Resolves #531
2020-06-10 18:28:28 +02:00
anshlykov
8bcfad48fa Migrate to JUnit 5
spring-cloud-function-context

spring-cloud-function-context: fix

spring-cloud-function-web

spring-cloud-function-adapters

spring-cloud-function-samples

spring-cloud-function-deployer; spring-cloud-function-kotlin

Resolves #535
2020-06-10 16:43:04 +02:00
Oleg Zhurakousky
ce28ce2cb6 GH-514 Remove 'proxyInvokerIfNecessary()' method
It is really not needed as it does not add much value other then allows user to cast POJO function to its actual type. The reality is that the actual goald of POJO function is to make sure they can be looked at as plain Functions.

Resolves #514
2020-05-26 15:46:42 +02:00
Oleg Zhurakousky
7bd84c79a2 GH-499,498 Add support for SupplierExporter to control output content-type
- Add 'contentType' property to ExporterProperties to assist SupplierExporter with delegating it to function catalog
- Add additional logging and testing
- Change JsonMapper to abstract class providing special handling of conversion of Json Sting to byte[]
2020-04-20 07:06:18 +02:00
Oleg Zhurakousky
fd93beefdb Fix regression for implicit composition
Also, added message check in AWS destination resolver
2020-04-16 21:05:20 +02:00
Oleg Zhurakousky
8f7672399f Extract common code from BeanFactoryAwareFunctionRegistry
. . . to ensure that we can have the version of FunctionRegistry that is not dependent on BeanFactory.
2020-04-16 13:42:17 +02:00
Oleg Zhurakousky
c41ee39358 Remove dead test 2020-04-06 18:26:13 +02:00