Commit Graph

188 Commits

Author SHA1 Message Date
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
Dave Syer
14867f9685 Add defensive null check 2017-06-07 14:46:59 +01:00
Dave Syer
d641aae494 Make spring.cloud.function.stream.endpoint optional for stream apps
If there is only one function you shouldn't have to set any configuration
to get a stream app to run. This also implementation supports multiple
functions, trying to guess which one to use based on the type of
the incoming message payload. In principle that could be strategized
as a simple router function (e.g. to look for a header with a function
name).

If there are functions and consumers in the same app, they will
subscribe to the same input channel (and hence by default Spring
Integration will load balance between them). This could also probably
use some more features, to specify the desired behaviour.

If user *does* supply spring.cloud.function.stream.endpoint then it
is used and overrides all other possible routes.
2017-06-02 18:11:25 -04:00
markfisher
9d0d04f4f6 updated task sample for consumer change 2017-05-26 15:26:25 -04:00
Dave Syer
9bf3601143 Fixed consumer sample to accept bare string 2017-05-26 12:51:56 +01:00
Dave Syer
2a4c46f57b Remove unused methods in compiled functions 2017-05-26 10:28:43 +01:00
Dave Syer
99c7b995e0 Add FunctionFactoryMetadata interface for type discovery
The compiled functions implement that interface which means you can inspect
the signature of the method that created them and discover its
generic types.
2017-05-26 10:09:47 +01:00
markfisher
5a7c95bd97 add type info for compiled functions 2017-05-25 12:38:54 -04:00
Dave Syer
098c77279b Revert AWS sample to use logback 2017-05-25 15:40:10 +01:00
Dave Syer
f843821ebe Make adapter parent deployable 2017-05-25 15:40:10 +01:00
markfisher
841d4cdf48 fix compiled consumer sample 2017-05-25 09:27:49 -04:00