Commit Graph

47 Commits

Author SHA1 Message Date
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
Oleg Zhurakousky
8001c49312 Final prep for 2.0.0.M1 release
Ignored few tests that are failing due to boot 2.1 no-override policy
2018-08-22 17:18:00 +02:00
Marcin Grzejszczak
44739b4a25 Preparing for 2.0.0.M1 release 2018-08-22 14:55:36 +02:00
Oleg Zhurakousky
20f02c94c2 GH-188 Ensured default ObjectMapper is created (AWS)
Ensured that the default instance of ObjectMapper is created in the event ObjectMapper configuration is missing (i.e., JacksonAutoConfiguration) in AWS adapter
Resolves #188
2018-07-11 15:44:51 +02:00
Dave Syer
4c9627aee3 Fix Build and upgrade fully to Boot 2.0
Some tests still ignored.

Also adds draft functional bean registration support. The AWS sample
is using that now (it starts up 4x faster in AWS). To activate the
functional beans user has to supply a main class of type
ApplicationContextInitializer.
2018-06-21 17:57:50 +01:00
Dave Syer
b59b43ddc5 Only expose Publisher via FunctionCatalog
Flux.from() is cheap and can be used to marshal the inputs everywhere
internally. With this change users ought to be able to register any
function of any Publisher type.
2018-05-01 12:06:34 -04:00
Halvdan Hoem Grelland
2c6f71d275 Add support for aggregated Kinesis records in SpringBootKinesisEventHandler
The current implementation of SpringBootKinesisEventHandler only handles
non-aggregated events. Attempting to process aggregated events caused
ungraceful failure.
This commit fixes that by de-aggregating any events before performing
conversion. Non-aggregated events are still handled transparently.
In addition, detection of Message<T> input is performed, and
output messages are wrapped accordingly.
2018-04-16 11:40:36 +01:00
Dave Syer
5aeba1ea96 Convert Consumer<Foo> to Function<Flux<Foo>,Mono<Void>>
This results in a better experience for users because the consumer
that they write is only applied to a Flux that is subscribed to
by the framework once. It gives better control over the flow of
foos, e.g. if some component wants to subscribe on a thread.
2018-03-26 10:06:13 +01:00
Dave Syer
33b33adb4b Change FunctionCatalog to key off Class<?>
Makes it possible to support other "function" types in the future.
The user is always taking a risk with the lookup that the object
returned has the generic type desired (but that hasn't changed
with this commit). FunctionCatalog is a lot simpler as a result
and also a lot more flexible.
2018-02-28 14:18:09 +00:00
Dave Syer
616e2825c6 Move FunctionCatalog into context module 2018-02-27 09:05:28 +00:00
Dave Syer
7604de3ca7 Attempt to write JSON by hand 2018-01-24 14:54:41 +00:00
Dave Syer
afd68680b3 Polish 2018-01-19 09:30:23 +00:00
Dimitry Declercq
8c963bf456 Example implementation for Aws API Gateway
User can extend SpringBootApiGatewayRequestHandler instead of the
generic SpringBootRequestHandler. It ties the code to AWS and the
API Gateway, but at least it supports the incoming data fully.

Fixes gh-111, closes gh-136
2018-01-18 13:01:10 +00:00
Dave Syer
939f5a8b1a Reflection hack to provide Spring Boot 2.0 compatibility 2018-01-09 13:01:24 +00:00
Dave Syer
1af0d451cf Migrate to servlet binder for web features 2018-01-03 15:06:33 +00:00
Dave Syer
3ccb925733 Merge core packages into one 2017-09-15 17:10:00 +01:00
Dave Syer
c8646d64d8 Strangle old inspector methods
Fixes gh-81
2017-07-13 13:37:45 +01:00
Dave Syer
87f077954e Try to detect single-valued returns in AWS
Lambdas generally only deal with single values anyway, but for
consistency we should return similar results from a Lambda handler
as from an MVC handler in s-c-f-web.
2017-05-24 13:27:10 +01:00
markfisher
719237e9c7 add adapters as child module 2017-05-23 16:30:18 -04:00