Commit Graph

223 Commits

Author SHA1 Message Date
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
Oleg Zhurakousky
aa87764580 Added initial docs module
Merged gh-89
2017-07-17 14:08:35 +01:00
Dave Syer
e2e7adabe4 Update some deps and remove gateway (moved to separate project) 2017-07-17 13:59:46 +01:00
Dave Syer
947ce93d77 Remove redundant comment 2017-07-17 13:54:37 +01:00
Oleg Zhurakousky
182317dbe9 Minor polishing of InMemoryFunctionCatalog
- Removed constructor in InMemoryFunctionCatalog that creates empty maps and no registrations since there is no way to register anything after catalog is created.
- Refactored registration logic a bit more functional/concise in the FunctionRegistration constructor of InMemoryFunctionCatalog
- Added additional assertions in tests

rebased and removed the assertion that was causing certain test failures
2017-07-13 16:07:53 +01:00
Dave Syer
ae14c236e1 Add travis config 2017-07-13 13:46:48 +01:00
Russ
b55417f772 Fix README typos 2017-07-13 13:39:21 +01:00
Dave Syer
c8646d64d8 Strangle old inspector methods
Fixes gh-81
2017-07-13 13:37:45 +01:00
Dave Syer
d7d49858f6 Add new methods to FunctionInspector 2017-07-13 13:37:06 +01:00
Dave Syer
7e966c73ca Adds routing keys in message headers
If the incoming message has a stream_routekey header, we use that
to route the message to a named function. Also adding the header
to messages coming out of suppliers.

The biggest change here is sort of orthogonal: it fixes a bug where
Spring Integration would subscribe twice to the same input channel
if the FunctionCatalog contains both functions and consumers. Then
when a message comes in it is dispatched to one or the other, but not
both. So the routing key couldn't work without fixing that
problem.
2017-07-13 13:32:32 +01:00
Dave Syer
4b30721d02 Fix naming indirection so that input types are correctly located
Also applies to output types, wrapper types and identifying if
messages can be processed directly.

See gh-81 (the ambiguity is still there, but the indirection bug
is fixed).
2017-07-11 17:39:42 +01:00