Commit Graph

277 Commits

Author SHA1 Message Date
Dave Syer
a2a2932715 Revert to snapshots 2018-02-21 07:24:21 +00:00
Dave Syer
72efd58675 Update to 1.0.0.M4 2018-02-20 19:25:11 +00:00
Dave Syer
8cd2675986 Add tests for various scenarios of message conversion 2018-02-16 10:31:28 +00:00
Dave Syer
1b624c3531 Support for isolated class loaders extended to cover more functions
Functions with Flux and Message (as well as POJOs and Flux of POJO
which were already supported) should now work if they are created in
an isolated class loader. Preconditions:

* The class loaders must have the reactor-core (and reactive-streams)
shared between the app and the function. Practically speaking this means
there has to be a parent class loader with just reactive types, and
sibling children for the app and the function. This is not a new
requirement (it was needed for Flux of POJO anyway).

* Message types are handled reflectively, so they don't have to be in a
shared class loader. But they do have to be  on the class path on
both sides (obviously).
2018-02-16 08:16:55 +00:00
Dave Syer
ccd3953163 Cache result of isMessage() computation before function is wrapped
Otherwise you get the wrong result when you go back and ask later
(but only if the bean is a singleton with no bean definition).
2018-02-14 16:25:12 +00:00
Dave Syer
c728cd4c01 Support for Function<Publisher<...>,...> 2018-02-14 14:09:28 +00:00
Kamesh Sampath
5b84ae0d7e Resolved Issue #141 2018-02-09 14:41:37 +00:00
Dave Syer
54873b66d5 Fix test 2018-01-25 09:36:37 +00:00
Dave Syer
ab30b755ba Add test to azure sample 2018-01-25 09:20:20 +00:00
Dave Syer
b0bddd3160 Handler for azure sample calls super in different method
If FooHandler extends AzureSpringBootRequestHandler apparently
Azure cannot extract the generic types Foo and Bar.
2018-01-24 15:56:40 +00:00
Dave Syer
7604de3ca7 Attempt to write JSON by hand 2018-01-24 14:54:41 +00:00
Soby Chacko
308e4d5514 Experimental Azure function adapter for HTTP trigger 2018-01-24 14:54:33 +00:00
Dave Syer
73098244e3 Revert to snapshots 2018-01-20 11:57:49 +00:00
Dave Syer
77e0a5c514 Update to 1.0.0.M3 2018-01-19 13:55:34 +00:00
Dave Syer
afd68680b3 Polish 2018-01-19 09:30:23 +00:00
Dave Syer
684735ed22 Update gradle builds to latest reactor 2018-01-18 13:11:02 +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
0ce1a81bd4 Update to latest Spring Boot 2018-01-18 09:32:06 +00:00
Dave Syer
224ee006bd Ignore VSCode config files 2018-01-18 09:16:52 +00:00
Dave Syer
939f5a8b1a Reflection hack to provide Spring Boot 2.0 compatibility 2018-01-09 13:01:24 +00:00
Dave Syer
7c29aa34c2 Avoid use of Spring Boot 1.5.x native APIs 2018-01-09 12:40:51 +00:00
Dave Syer
8a65cabb90 Remove unnecessary dependencies 2018-01-05 16:18:27 +00:00
Dave Syer
7b46f925d7 Switch to SmartInitializingSingleton to avoid early instantiation
Use of BeanProcessor to catch a bean before it is used is a bit
agricultural these days. SmartInitializingSingleton is better and
frees application logs from one more annoying INFO log on an
early instantiation

2018-01-04 14:17:05.930  INFO 23472 --- [       Thread-0] trationDelegate$BeanPostProcessorChecker :
  Bean 'org.springframework.cloud.function.web.flux.ReactorAutoConfiguration' of type
  [org.springframework.cloud.function.web.flux.ReactorAutoConfiguration$$EnhancerBySpringCGLIB$$8d4844e]
  is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-04 14:27:32 +00:00
Dave Syer
9c1a9bff4e Fix reactor dependencies 2018-01-03 15:59:20 +00:00
Dave Syer
1c0b603986 Add back spring-cloud-function-web (faster startup)
With this change there are now 2 choices for web endpoints. The
stream servlet binder is useful for multi-binder use cases
(e.g. HTTP -> message broker).
2018-01-03 15:06:33 +00:00
Dave Syer
1af0d451cf Migrate to servlet binder for web features 2018-01-03 15:06:33 +00:00
Dave Syer
540b4d378e Update sample builds to latest versions 2017-12-11 15:39:01 +00:00
Dave Syer
2895a4597d Add vscode cache to ignored files 2017-12-11 15:39:01 +00:00
Dave Syer
5314466655 Add notes on Start-Class and MAIN_CLASS
Fixes gh-128
2017-12-04 09:40:50 +00:00
Dave Syer
be61ad07bd Clean up class loader on close() 2017-12-04 09:40:42 +00:00
Dave Syer
91c3770ce6 Upgrade Spring Cloud in the deployer too 2017-12-01 10:31:18 +00:00
Dave Syer
e0cb718138 Update to Ditmars/Bismuth 2017-12-01 10:31:18 +00:00
Artem Bilan
46fdca479b Properly resolve FactoryBean for function
Fixes: gh-118

When the `BeanDefinition` for `Function` is a `FactoryBean`
(e.g. `GatewayProxyFactoryBean` in Spring Integration) and that
`BeanDefinition` isn't registered as `@Bean` method (e.g.
Spring Integration Java DSL parser), the `ContextFunctionCatalogAutoConfiguration`
doesn't resolve the target `Function` type properly

* Get the target `Function` bean type via `BeanFactory.getType(String)`
* Make fallback to the `Object.class` instead of bean type since we are
expecting here a generic type anyway
2017-12-01 10:31:18 +00:00
Dave Syer
47fd4c3ed2 Going back to snapshots 2017-12-01 10:31:18 +00:00
Dave Syer
6cc2289f38 Update mvnw script to choose profiles 2017-12-01 10:29:57 +00:00
Dave Syer
b6310e1811 Update SNAPSHOT to 1.0.0.M2 2017-11-28 13:40:35 +00:00
Dave Syer
24bd68ddb9 Remove s-c-stream as mandatory dependency
Fixes gh-130
2017-11-28 13:32:35 +00:00
Dave Syer
9c8003eea6 Update Spring Boot version 2017-11-28 13:13:50 +00:00
Dave Syer
f2cde3ffbf Update thin launcher to 1.0.8 2017-11-28 11:43:56 +00:00
Dave Syer
e824fbf6cb Isolate the context class loader if function appears to need it
When a function is created using an isolated class loader it might
want to use that class loader again for its invocations, and a lot
of tools (Spring etc.) use the context class loader for that kind
of thing if they don't have an explicit default value. So we
set the context class loader before, and unset it after, the
function invocation using a convenience wrapper.
2017-11-25 05:25:29 +09:00
Dave Syer
e1bce8c292 Change name of property endpoint -> defaultRoute 2017-11-24 13:28:31 +09:00
Dave Syer
f3951cba66 Prefer explicit route to default 2017-11-24 13:21:08 +09:00
Dave Syer
0e21a30459 Don't use properties to fix the function endpoint
There are multiple functions in this sample, and they are
all addressable, so we don't need to force all messages to go
to uppercase.
2017-11-24 12:42:21 +09:00
Dave Syer
1ee517ab01 Use unique function if there is only one and name not provided
If the user doesn't ask for a specific function, but there is only
one possible choice, we can just use that.
2017-11-24 12:41:10 +09:00
Dave Syer
8459fb4e30 Ensure a concrete type with parametrric subtype is detected
If user defines their own @Beans from conrete types that implement
Function<...> then their type signature is detectable from the
class.
2017-11-20 15:34:06 +00:00
Dave Syer
7bf7b8b9c0 Update to latest snapshot of thin launcher 2017-11-17 15:04:41 +00:00
Dave Syer
66beae56bd Add test for multi-valued response 2017-11-15 13:57:05 +00:00
Dave Syer
219d056801 Add FunctionRegistry interface (writable FunctionCatalog)
This makes dynamic function registration (after context starts) much
easier. Also frees us from having to employ BeanFactoryPostProcessor
and other tricks to get the functions registered on startup.
2017-11-13 14:13:59 +00:00
Dave Syer
41d1dfa6bc Add public registration method to bean post processor
Also simplifies logic of looking up message types
2017-11-13 09:27:36 +00:00
Dave Syer
85ba0b480e Fallback to Object.class not the function type
See gh-118 (partial fix)
2017-11-10 17:38:45 +00:00