Commit Graph

198 Commits

Author SHA1 Message Date
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
markfisher
18743fdf17 add license (Apache 2.0) 2017-07-07 12:51:42 -04:00
Dave Syer
a54f101b6d Make sure test jar is in test scope 2017-07-06 11:11:02 +01:00
Dave Syer
eeb505ca89 Clean up resources when deployer app is closed 2017-07-04 15:04:00 +01:00
Dave Syer
becc41d9ef Ignore .m2 (for CI build) 2017-07-04 14:31:25 +01:00
Dave Syer
31116b8e02 Update thin deployer 2017-07-04 14:17:03 +01:00
Dave Syer
0419fbc2ac Refactor deployer app so that it starts empty
Functions are namespaced under the "app name", e.g.
/sample/uppercase is the "uppercase" function in the "sample" app.

Also added a README to get started quickly.
2017-07-03 17:00:55 +01:00
Dave Syer
42a50861c0 Push bookeeping of names and ids down a level in deployer
The controller doesn't need to know the mappings, and it helps
to keep them closer to the actual AppDeployer, so in a future
change we can use the app names to look up functions.
2017-07-03 14:58:55 +01:00
Dave Syer
6d6c7ef8b3 Add caching to pipeline 2017-07-03 14:56:06 +01:00
Dave Syer
da0c954135 Add get*Names() to FunctionCatalog
We could go wit a separate interface, but it seems sensible to
keep it together really, so that callers don't have to downcast.
2017-06-29 14:43:19 +01:00
Dave Syer
2dd7dfb900 Tweak logic in stream invokers
* If there is only one function, use it unconditionally
* If no functions match, ensure that null is not the selector
* If a conversion succeeds, check the type of the result
2017-06-29 14:29:01 +01:00
Dave Syer
cf707fd872 Update thin launcher to 1.0.5 2017-06-29 08:50:33 +01:00
Dave Syer
d826884d02 Ensure @Component scanned from jar on classpath can be inspected
And test it using a new POF sample.
2017-06-28 17:52:37 +01:00
Dave Syer
d1ccef62b5 FunctionHandlerMapping needs to be defensive with debug flag
Spring Boot apps often run with --debug (no boolean value), so
we need to be defensive and not barf if it's empty (and therefore
not convertible to a boolean)
2017-06-28 15:07:07 +01:00
Dave Syer
78ca4df128 Update CI pipeline with new repo location 2017-06-28 11:27:17 +01:00
Dave Syer
5243057d2a Skip deployment of samples 2017-06-28 11:07:47 +01:00
Dave Syer
f94d672dc4 Add test and fix type inspection for scanned functions
Fixes gh-73
2017-06-28 11:00:07 +01:00
Dave Syer
e4b181d0c4 Fix /prefix test so it asserts a 404 as well as a 200 2017-06-28 09:41:04 +01:00
Dave Syer
b9eb46c7bd Update thin launcher to 1.0.4 2017-06-27 09:47:43 +01:00
Dave Syer
eb8d865bd1 Update openwhisk README to use sample from the project
The io.spring sample referred to in the openwhisk README isn't
in this repo, so users generally don't have it installed locally.
This change makes it more obvious that you have to create your
own.

Also fixes the `wsk ...` command lines (the order of arguments
was wrong - maybe the CLI changed?).
2017-06-26 12:19:21 -04:00
Dave Syer
b61562508b Add support for Message handling in web functions
If the output is a Message we grab the headers from the first one
and send those as response headers.

A function can add headers to messages. The HTTP response will
contain only headers that are in x-* _or_ were added to the message
by user (i.e. they weren't in the request).
We certainly do not want to pass through all HTTP headers (request
headers can conflict with or invalidate response headers).
2017-06-22 09:45:12 +01:00
Dave Syer
1d53cd1234 Ensure debug flag gets resolved in controller 2017-06-22 09:45:12 +01:00
markfisher
9d0cf75bff initial commit for openwhisk support 2017-06-16 09:43:10 -04:00
Dave Syer
0756dc3394 Add support for Message<Foo> in stream apps
The FunctionInspector needs to be able to distinguish between a
function of Flux<Foo> and a function of Flux<Message<Foo>>. Then
it can do the conversion a level below.

Only supports Message->Message or POJO->POJO (no mixtures), so there
is only one new method in FunctionInspector.

No support in the web endpoints yet. But it's probably not so hard
to add.
2017-06-15 12:32:46 +01:00
markfisher
797936fd0c add README for AWS adapter 2017-06-07 19:05:36 -04:00
Dave Syer
347cfcef03 Add concourse pipeline 2017-06-07 12:50:50 -04:00