Commit Graph

247 Commits

Author SHA1 Message Date
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
Dave Syer
d4b87c1fe7 Initial support for composable functions
There's a test for each of the supported types. No error handling
yet.

Fixes gh-122
2017-11-10 16:45:11 +00:00
Dave Syer
2438baff10 Add TODO comment 2017-11-10 14:45:59 +00:00
Andy Clement
aaa6b6526c Faster compilation of functions
This change includes caching and smarter analysis of classpaths
to limit the amount of jar walking necessary to find dependencies
when compiling. It also includes some new tests that verify
packaging of dependencies in boot style form (BOOT-INF/lib and
BOOT-INF/classes).
2017-11-10 14:45:46 +00:00
Dave Syer
8d5f09efa1 Add sample test data to README 2017-11-10 13:02:22 +00:00
Dave Syer
ad0ebd5cfc Add additional logic to function catalog to help with singletons
A registered singleton doesn't have a BeanDefinition, but it might have
a compiled type with enough generic information to pull out the
input and output types.
2017-11-10 12:11:55 +00:00
Dave Syer
7d7a783f0e Update maven wrapper 2017-11-05 12:52:31 +00:00
Dave Syer
d58c58b765 Add heuristic for Spring Boot fat jar
The function compiler knows how to extract jars nested inside
a Spring Boot fat jar. It's really slow (so that's maybe another
problem for another day), but it works now.

Fixes gh-115
2017-10-25 10:19:39 +01:00
Dave Syer
b1437fe9c0 Align pom names with artifact ids 2017-10-25 09:50:18 +01:00
Dave Syer
55b62d630b Remove @FunctionScan from samples where possible 2017-10-25 08:53:14 +01:00
Dave Syer
a27f1fe4dd Switch on @FunctionScan by default 2017-10-25 08:53:14 +01:00
Dave Syer
30b0d3a1c6 Introduce special handling for unconverted messages
Prevents odd looking exceptions when null pops into the stream
unexpectedly.
2017-10-25 08:53:14 +01:00
Manos Nikolaidis
08f2cb2491 Update README.adoc
Use correct path for samples. E.g. look at:

https://github.com/spring-cloud/spring-cloud-function/tree/master/spring-cloud-function-samples
2017-10-25 08:49:25 +01:00
Erik Möller
49178f0389 Changed path from spring-cloud-function-sample-compiler to function-sample-compiler 2017-10-25 08:48:58 +01:00
Dave Syer
280fa5794c Subscribe to supplier flux in background thread
Stops application from blowing up if there are messages available
on startup and the broker is not there. There are still errors
(failed messages), but it doesn't stop the app from starting.

Maybe should be optional to fail fast?
2017-09-22 09:45:37 +01:00
Dave Syer
af8b6e253e Revert to snapshots 2017-09-15 17:49:31 +01:00
Dave Syer
858b7404c6 Update to 1.0.0.M1 2017-09-15 17:48:51 +01:00
Dave Syer
3ccb925733 Merge core packages into one 2017-09-15 17:10:00 +01:00
markfisher
dce30023e8 remove unused code 2017-09-15 11:36:46 -04:00
Oleg Zhurakousky
37fc3e6c65 Removed EmptyIterable
- Removed EmptyIterable as it's only used by _MemoryBasedJavaFileManager_
to ensure the contract of the _list(..)_ operation that must not return
null. The same contract is ensured with _new
IterableClasspath(classpath, packageName, recurse)_ while making
_MemoryBasedJavaFileManager.list(..)_ simpler and more consistent.
- Untill this fix the AbstractByteCodeLoadingProxy was building FQCN of
the byte-array defined class using Resource.getFileName() and then some,
which is not very reliable since if such name does not match the actual
name contained in the byte code, class loading will result in exception.
So, this fix reads FQCN from the actual byte code..
- Reduced visibility of AbstractByteCodeLoadingProxy
- Simplified ByteCodeLoadingFunctionTests

Closes gh-99
2017-09-15 16:30:12 +01:00
Dave Syer
986e76610c Clarify some things in the AWS adapter 2017-09-15 14:04:45 +01:00
Dave Syer
fbf62658e7 Cosmetic changes to metadata of sample 2017-09-15 13:51:40 +01:00
Dave Syer
dcdde7e067 Move AWS sample alongside other samples 2017-09-15 13:48:33 +01:00
Dave Syer
472f0e31b6 Prune dependencies and rename samples 2017-09-15 13:44:55 +01:00
Dave Syer
976854929e Update to new docs standards 2017-09-15 11:44:25 +01:00
Dave Syer
fe89d91c8c Add flatten plugin to publish poms with no hierarchy
Also strips out repositories and profiles and other stuff that users
don't need in their dependency management. And adds the license
and project metadata automatically.
2017-09-15 11:10:31 +01:00
Dave Syer
61a902ce9a Add spring-cloud-function-dependencies and use it throughout 2017-09-15 09:34:44 +01:00
Dave Syer
55655d69ac Update thin plugin in AWS Sample gradle build
See also gh-109. So there is a TODO in there to fix the configuration
and when the thin launcher 1.0.7 comes out we should update the version
as well. But it's working now, and quite similar to the Maven output,
except for the thin.properties.

Fixes gh-108
2017-09-05 11:52:43 +01:00
Dave Syer
b7aa1d0293 Add gradle builds to all samples
They all work except the AWS one, where the shadow plugin seems to
prang the thin launcher one. Removing the thin plugin gets us
something that works.

Fixes gh-105
2017-09-04 17:59:55 +01:00
Dave Syer
6acacde0b3 Add build.gradle to basic sample 2017-09-04 17:59:39 +01:00
Dave Syer
69a5d1450f Add explicit context dependencies 2017-09-04 17:59:31 +01:00