Commit Graph

45 Commits

Author SHA1 Message Date
Dave Syer
2438baff10 Add TODO comment 2017-11-10 14:45:59 +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
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
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
Dave Syer
61a902ce9a Add spring-cloud-function-dependencies and use it throughout 2017-09-15 09:34:44 +01: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
947ce93d77 Remove redundant comment 2017-07-17 13:54:37 +01:00
Dave Syer
c8646d64d8 Strangle old inspector methods
Fixes gh-81
2017-07-13 13:37:45 +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
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
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
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
Marius Bogoevici
e117cfd5bd Tentatively fix streaming issues
* Assume that the Function returned by FunctionCatalog
  is already wrapped as Function<Flux<?>,Flux<?>>
2017-04-27 07:34:24 +01:00
Marius Bogoevici
4a1972dcf1 Add conversion support for Stream 2017-04-25 08:28:38 +01:00
Dave Syer
36c6b2dba7 Update versions of boot things 2017-04-12 17:57:28 +01:00
Marius Bogoevici
70dff6bb6b Enable JSON conversion for non-Flux functions
- use ProxyWrapper around a FluxConsumer as well
  making it consistent with the behaviour of Flux
  functions
- Enable introspection for scanned beans
- Fix failing tests by passing JSON string as input messages
  (marshalled form expected from the binder)
2017-04-06 08:24:51 +01:00
Dave Syer
d1cf9b47a4 Add some failing tests 2017-04-05 13:40:24 +01:00
Marius Bogoevici
82e19894b2 Add stream-function tests 2017-04-04 00:25:12 -04:00
markfisher
d208b5e0f3 stream consumer invoker target now expects Flux 2017-03-31 12:09:04 -04:00
Dave Syer
da013c1015 Purge warnings in IDE 2017-03-14 18:21:41 +00:00
Oleg Zhurakousky
2a0653b0e7 Removed redundant entries from POM files
Polished POM files to remove redundant entries that were causing warnings in the IDE. Some notable changes are:
- Removed spring-boot.version from sample project as they inherit it from the parent
- Removed versioning for maven-jar-plugin (was 3.0) from multiple project so it relies on the managed version
- Removed java.version from all spring-cloud-function-* modules as they inherit the one from parent.

Addressed PR comments
- removed references to maven-jar-plugin
2017-03-11 18:31:32 -05:00
markfisher
2ae7789cd1 add interval for non-Flux stream Suppliers 2017-03-02 11:13:01 -05:00
markfisher
19fd056a5e add support for simple (non-Flux) types
add objectToStringHttpMessageConverter

CompilerController accepts parameterized types
2017-02-24 12:14:57 -05:00
Dave Syer
fa86e5fb1f Update reactor versions 2017-02-24 10:07:01 +00:00
Dave Syer
d6a4ccf001 Update thin launcher to snapshot for fixes 2017-02-23 14:50:48 +00:00
markfisher
5939f96016 renaming stream function property 2017-02-13 09:23:41 -05:00
markfisher
0a6dce951b add support for function composition 2017-02-06 15:55:53 -05:00
markfisher
94a78bdc7f add Function compiling webapp and update scripts 2017-01-19 15:55:49 -05:00
markfisher
8205c579f2 added Supplier and Consumer support 2017-01-11 14:48:21 -05:00
Dave Syer
55ab25b348 Fix dependency management in stream jar 2017-01-11 08:28:49 -05:00
Dave Syer
9321dc7311 Remove function composition from the catalog interface
Should be easy enoug hto add back later, but it was causing issues
with type conversion where we are npot yet sophisticated enough
to chain functions together and keep track of the types being
passed between them.
2017-01-10 12:37:29 -05:00
Dave Syer
4ad01be090 Add support for server-side events and tests
User can POST to web endpoint in SSE style, i.e:

HTTP/1.1
Content-Type: text/event-stream

data:foo

data:bar

Will be converted to a Flux with values foo and bar
2017-01-06 12:43:38 +00:00
Dave Syer
91717ec9a6 Convert functions etc. after context starts
The app deployer now has to reach into the function contexts and
extract a catalog and call its methods reflectively.
2017-01-04 17:48:13 +00:00
Dave Syer
c6736f959b Add a sample app with just beans that are Functions
Make it deployable via its maven coordinates in
spring-cloud-function-deployer (it is deployed by default on start
up right now, but that's just a demo)
2017-01-03 15:16:13 +00:00
markfisher
4e7de96dc9 function invoker is conditional on input 2016-12-05 10:08:02 -05:00
markfisher
b0db0233be add support for Supplier and Consumer 2016-10-14 20:40:48 -04:00
markfisher
8e5d631db9 support function composition for web and stream 2016-10-01 16:52:59 -04:00
markfisher
309993f0d4 file-based registry for serialized functions 2016-10-01 15:30:25 -04:00
markfisher
64d6975cfd added boot plugin 2016-09-22 12:12:35 -04:00
markfisher
bdd39b74ff initial commit 2016-09-21 22:33:06 -04:00