Commit Graph

233 Commits

Author SHA1 Message Date
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
Andy Clement
a004242089 Fix #87 - normalize to forward slashes
On windows when walking through jar contents some files use
forward slashes and some backslashes. With this change we
switch to a consistent usage of forward slashes throughout
(converting backslashes to forward when necessary). With these
changes the testsuites work on windows.
2017-08-29 19:10:23 -04:00
Eric Bottard
aa45ff4b94 Revert visibility of FunctionRegistration to public
Fixes #102
2017-08-24 19:21:29 +02:00
Oleg Zhurakousky
a973b678f1 FunctionUtils polishing
- attempted to make code more functional (eat our own dog food) and concise
- addressed PR comment
- additional cleanup/polishing of FunctionUtils and related classes
- Removed Function/Supplier/ConsumerProxy classes by extending type info on their super interface
- Renamed FunctionUtils to FunctionFactoryUtils
- Added javadoc to FunctionFactoryUtils to explain its design considerations as well as what it can and can not doi

Fixes gh-90
2017-08-22 14:07:42 +01:00
daprog
2644ab3178 Field value in action request change from Map<String,String> to Map<String,Object> 2017-08-22 11:08:44 +01:00
Oleg Zhurakousky
592eef9d52 General polishing
- minor refactoring of FunctionRegistration and some javadoc
 - general cleanup of ContextFunctionCatalogAutoConfiguration (mainly consolidated repeatable code)

Fixes gh-98
2017-08-22 10:34:13 +01:00
Oleg Zhurakousky
20561ea987 CompiledFunctionRegistry cleanup 2017-08-15 10:56:57 -04:00
Oleg Zhurakousky
11b8654e09 AbstractFunctionCompiler cleanup
- removed Function/Supplier/ConsumerFactories by modifying SOURCE_CODE_TEMPLATE
- removed Example main from src/main/java/org.springframework.cloud.function.compiler
2017-08-15 10:45:43 -04:00
Andy Clement
2fdfda9416 Allow dependencies to be specified when compiling, using maven coords 2017-08-15 09:09:35 -04:00
markfisher
5ba41cd3ce add CONTRIBUTING.adoc 2017-08-09 15:42:22 -04:00
Dave Syer
31f4afa5ff Off by one error in comment 2017-08-08 09:47:48 +01:00
Dave Syer
5622a9e2cb Remove custom conditions from spring-cloud-function-stream
It didn't really make any sense to have custom conditions that
depend on the presence or absence of beans of type Function,
Supplier, Consumer because the actual endpoints are derived
from the FunctionCatalog (which might not be based on
bean definitions). This approach is far simpler, and
reduces the amount of custom code in the stream binder.

The spring.cloud.function.stream.supplier.enabled flag
is awkward, so we should try and find a way to avoid that.
There's also no reason it should need to be set in the
deployer tests.
2017-08-08 09:39:15 +01:00
Dave Syer
3c412e04f5 Attach javadoc to parent project 2017-07-18 13:43:07 +01:00
Dave Syer
15f0a0bcc9 Add correct file path to compiler 2017-07-17 17:18:44 +01:00
Dave Syer
0d51e87f10 Add javadoc aggregator 2017-07-17 15:15:14 +01:00