Commit Graph

68 Commits

Author SHA1 Message Date
Oleg Zhurakousky
ed99439f0b GH-552 Fix Consumer support in FunctionInvoker
Further refactor FunctionInvoker to utilize functionality of AWSLambdaUtils
Add Consumer test

Resolves #552
2021-01-26 10:41:25 +01:00
Oleg Zhurakousky
75112076f7 GH-630, GH-530 Additional improvements in AWS Custom Runtime
Ensured we have Custom Runtime examples for functional and '@Bean' style
Improve AWSLambdaUtils to ensure it works without APIGatewayProxyRequestEvent on classpath
2021-01-22 12:31:31 +01:00
Oleg Zhurakousky
a1d10f0771 GH-530, GH-630 Improvements to AWS Custom Runtime
This commit provides initial set of improvements to executing functions in AWS Custom Runtime
- Consistent invocation model for functional as well as @Bean configuration models via new CustomRuntimeEventLoop as well as AWSLambdaUtils
- Clean up classpath to decrease the size of the JAR/ZIP file
- Configuration simplification which no longer requires enabling of function exporter

It also allows user to define functions that rely on AWS types such as APIGatewayProxyRequestEvent

The existing invocation model remains in tact for the time being. Both invocation models are mutually exclusing in theit setup to avoid potential conflict.

Resolves #538
Resolves #630
2021-01-21 22:20:32 +01:00
Oleg Zhurakousky
555526192f GH-618 Remove dependency on FunctionInspector from AWS FunctionInvoker
Resolves #618
2020-12-08 15:00:56 +01:00
Oleg Zhurakousky
c2d8f58e32 Polish to fix build 2020-11-03 15:38:27 +01:00
Oleg Zhurakousky
14ab5ac1b3 Disconnect FunctionInspector from adapter request handlers and Kotlin module 2020-10-20 13:58:51 +02:00
Oleg Zhurakousky
818cda144c Deprecate and remove all usages of FunctionInspector 2020-10-19 18:11:11 +02:00
Oleg Zhurakousky
3f1315c523 Consolidate isMessage() operation 2020-10-19 14:57:55 +02:00
Oleg Zhurakousky
89466b5cdc Refactor FunctionCatalog implementation 2020-10-16 17:59:06 +02:00
Oleg Zhurakousky
21e49aa8e2 GH-574 Fix String wrapping for input/output for AWS APIGateway
As suggested by the user we were improperly wrapping the String payload for input/output during APIGateway interaction

Resolves #574
2020-08-06 16:01:12 +02:00
Oleg Zhurakousky
b245812c6b GH-562 Add type conversion documentation
Add test in AWS to showcase type conversion
Fix AWS FunctionInvoker to delegate to effectively delegate type conversion to the native mechanism of spring-cloud-function

Resolves #562
2020-07-29 20:17:03 +02:00
Oleg Zhurakousky
fa1c27b754 GH-563 Add support for SNSEvent (AWS)
Resolves #563
2020-07-24 15:53:03 +02:00
Oleg Zhurakousky
cefe52365b GH-560 Add explicit support for S3 AWS Event
Resolves #560
2020-07-16 09:41:23 +02:00
Oleg Zhurakousky
840646991c GH-551 Fix support for AWS SQSEvent
Resolves #551
2020-06-22 08:21:04 +02:00
anshlykov
dfa02750c1 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
d6bfac3684 Polishing 0df050ec32 2020-05-27 14:51:51 +02:00
Oleg Zhurakousky
0df050ec32 Fix AWS FunctionInvoker to ensure it properly interprets translation of incoming APIGateway request to user FunctionInvoker
This assumes that
- 'body' will be extracted for cases such as POJO or String input
- Map input will simply represent the incoming request
- APIGatewayProxyRequestEvent input represents native representation of API Gateway request

Similar fixes went for Kinesis side of things
Added additional tests for both Kinesis and ApiGateway
2020-05-27 13:51:30 +02:00
Oleg Zhurakousky
27494567a0 Add propagation of HTTP headers
Polish function composition logic
2020-04-20 18:13:45 +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
01458c7e42 GH-469 Add id to the CustomRuntimeAutoConfiguration bean registration
The name is the decapitalized name of the CustomRuntimeAutoConfiguration class name

Resolves #469
2020-03-31 16:44:42 +02:00
Oleg Zhurakousky
85000ee084 GH-460 Add support for function filtering
Added support for function filtering in the event there are more then one function in catalog. This is primarily to ensure that
we have a mechanism to specify which functions to export as web enpoints (instead of all)

Resolves #460
2020-03-23 11:19:40 +01:00
Oleg Zhurakousky
b71c793dab GH-458 Remove default dependency on ApplicationJsonMessageMarshallingConverter
Resolves #458
2020-03-10 16:13:28 +01:00
Oleg Zhurakousky
01360df41e GH-438 Added initial support for ALB request/response
Added initila support for Application Load Balancer request and response events. This support for now is only protocol based (see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html#respond-to-load-balancer)
Added initial tests

Resolves #438
2019-12-26 11:25:13 +01:00
Oleg Zhurakousky
f094ea8595 GH-399 Moved initialization of AWS context to constructor
Moved initialization of AWS context to constructor for new FunctionInvoker

Resolves #399
2019-12-16 20:25:09 +01:00
Oleg Zhurakousky
52b0fdea50 GH-434 Added generic FunctionInvoker for AWS
- Added generic FunctionInvoker capable of handling the request generically without requiring user to implemen specific AWS request handler

Resolves #434
2019-12-16 14:27:41 +01:00
Oleg Zhurakousky
93f7a248a5 Added initial support for lazy style FunctionCatalog/Registry which:
-  does not rely on any of the existing wrappers and instead relies on internal wrapper which performs  in-flight/just-in-time wrapping and unwrapping from reactive to imperative types
- performs transparent type conversion relying on MessageConverters and ConversionService
- supports multiple inputs/outputs
2019-07-17 13:54:02 +02:00
Dave Syer
5e3111bf80 Fix conditions for custom AWS runtime
Conflicts:
	spring-cloud-function-samples/function-sample-aws-custom/pom.xml
2019-07-12 17:08:34 +02:00
Kane Zhu
1de8526b7a Fix the issue that api gateway handler of AWS does not honor the encrypted body data.
Resolves #382
2019-07-12 17:07:02 +02:00
Oleg Zhurakousky
cf5cd49b72 fixed checkstyle 2019-07-12 17:04:45 +02:00
Oleg Zhurakousky
493b9da295 Simplified enhanecements to SpringBootApiGatewayRequestHandler introduced by previous commit"
Resolves #249
Resolves #375
2019-07-12 16:59:33 +02:00
Markus Gulden
01e813ec52 GH-249, Add full HTTP support to SpringBootApiGatewayRequestHandler
* Add support for handling APIGatewayProxyRequestEvent objects with
empty body (should apply to all GET and DELETE requests, which
comply with recommandation of RFC-7231)

* Add support ReSTful APIs: path and query string parameters as well
as the HTTP method are now extracted from the
APIGatewayProxyRequestEvent object and forwarded to the function
as message headers

* Extend unit tests accordingly
2019-07-12 16:59:21 +02:00
Oleg Zhurakousky
2afb53f967 Added cleanup code to the failing AWS test 2019-06-07 14:41:45 +02:00
Oleg Zhurakousky
f2e4cea47d GH-263 Added more AWS tests
Resolves #263
2019-05-03 09:27:04 +02:00
Oleg Zhurakousky
bd094bef39 GH-349 Added support for raw input to AWS adapter
Resolves #349
2019-04-08 14:18:19 +02:00
Dave Syer
744a7587d3 Narrow condition for function exporter in AWS custom runtime 2019-04-01 15:50:57 +01:00
Dave Syer
2efeafd793 Conditionally switch on the custom runtime in a functional app 2019-04-01 15:38:13 +01:00
Spring Operator
3b573c27ac URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 247 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 12:48:58 -05:00
Dave Syer
138e1cf3c2 Deeper support for custom AWS Lambda runtime
Adds an EnvironmentPostProcessor so the user ony has to set one
property (spring.cloud.function.web.export.enabled=true).
2019-02-28 10:05:13 -05:00
Dave Syer
428243ce48 Add new feature to initialize a Supplier from a remote HTTP endpoint
Kind of like the SupplierExporter but to create the Supplier itself.
With this in place you can define the templateUrl (destination) and
the originaUrl (source) and use the app as a pipeline for events
from/to HTTP.

Provide functional bean support for HTTP export

Add autoconfig to AWS adapter for custom runtime

Fix HttpSupplier to always supply Message if headers are included

Fix registration of origin supplier in functional beans

Add docs on new AWS features

Add custom runtime sample
2019-02-28 09:55:51 +01:00
Oleg Zhurakousky
cdca44f714 Polished adapter initializers consolidation effort
- Added ability to retrieve input type from FunctionRegistration (if available) in AbstractSpringFunctionAdapterInitializer
- Removed azure/AzureSpringFunctionInitializer and aws/SpringFunctionInitializer
- Added additional tests in AWS and Azure modules
- See 0189c578ef for additional info
2019-02-25 19:37:34 +01:00
Oleg Zhurakousky
0189c578ef GH-266 Consolidated Adapter infrastructure
- Moved common logic into a new AbstractSpringFunctionAdapterInitializer
- Modified Azure and AWS request handlers to extend from it
- Deprecated both AzureSpringFunctionInitializer and SpringFunctionInitializer(AWS)

Resolves #266
2019-02-25 13:25:08 +01:00
Oleg Zhurakousky
0994a244e0 Polishing, fixed checkstyles, added author tag
Resolves #256
Resolves #260
2019-02-15 10:39:59 +01:00
Semyon Fishman
8c4c1aefde GH-256, Add AWS support for Consumer's and Supplier's
Added support for Consumer and Supplier functions when executing within AWS Lambda.

It appears that this was previously supported but was removed in 083d5e for some reason.

Improve Consumer support for AWS API Gateway

Consumer type functions, by definition, do not return anything; i.e. they do not have a response.  However when executing within a Lambda + API Gateway environment, the Lambda must still return a 200-level status response to signal the API Gateway that the function executed succesfully.   I added the logic for this.

Improve Supplier support for AWS API Gateway

Supplier functions, by defnition, do not take input; in the case of API Gateway calls this type of execution passes a null body, which fails to deserialize and throws an exception.  I added logic that skips the deserialization of the body in the case it is a Supplier.
2019-02-15 10:23:54 +01:00
Marcin Grzejszczak
c6ddfe1af4 Added checkstyle for tests 2019-02-03 15:34:10 +01:00
Marcin Grzejszczak
e4b08a083c Turned on checkstyle 2019-02-01 15:48:32 +01:00
Dave Syer
4315cb1d61 SpringApplication->FunctionalSpringApplication (less confusing) 2018-10-18 09:38:27 +01:00
Dave Syer
666bc100e8 Extract functional bean definition concerns into a common class
SpringApplication looks like the class with the same name in Spring
Boot (and is a subclass of it), but it checks to see if the user
is asking for functional bean registrations and only used those if
it can.
2018-10-12 18:00:41 +01:00
Dave Syer
083d5e3bf3 Harmonize AWS and azure adapters 2018-10-12 17:10:13 +01:00
Oleg Zhurakousky
e1c2610105 GH-206 Ensured consistency in header names
added Copyright/aithor tags

Resolves #206
2018-09-12 22:10:10 +02:00