Commit Graph

41 Commits

Author SHA1 Message Date
Dave Syer
5055369cb5 Fix prefix issue 2017-04-24 16:31:09 +01:00
Dave Syer
2b88eaeb08 Extend support for simple types to Consumer and Supplier
The function catalog now always wraps beans that deal with non-flux
generic types.
2017-03-31 14:08:35 +01:00
Dave Syer
07c9d1c460 Remove unused method parameter 2017-03-31 13:56:25 +01:00
Dave Syer
38dcbaffff Add test for priority of looking up supplier in GET mapping 2017-03-31 13:48:36 +01:00
Dave Syer
cadd5546da Add custom HandlerMapping to allow more flexible request mapping 2017-03-31 13:44:11 +01:00
Dave Syer
787ab65d55 On POST to a Consumer, reflect input and send 202 2017-03-30 16:42:19 +01:00
Dave Syer
0d08735dda Test POST to Consumer
See gh-36
2017-03-30 16:42:19 +01:00
markfisher
98c2ca76f5 avoid Supplier NPE 2017-03-18 21:38:08 -04:00
Dave Syer
915ff401be Make GET /{function}/{value} single valued (Mono)
When the user has sent us a single value, we can make the signature
of the handler and the format of the HTTP response much more
natural if it is single valued too (i.e. a Mono).
2017-03-13 15:01:10 +00:00
Dave Syer
9b24d23df8 Add configurable base path for web resources 2017-03-13 13:43:26 +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
Dave Syer
2ee97721ab Support HTTP GET of single value value Function
E.g. a Function<Long, Foo> can be used to fetch a single entity of
type Foo with a long ID., via /{function}/{id}
2017-03-10 16:33:34 +00:00
Dave Syer
17b644f563 If HTTP client asks for JSON, then time out the response
An HTTP response does not have to be an infinite stream, and in fact
life is simpler if it is not. The timeout in the web wrappers can
be used to close the response and return normally to a client
that has been waiting more than (say) 1s, instead of treating
it as an error condition.

Error handling is still kind of unsolved.
2017-03-09 16:10:08 +00:00
Dave Syer
ec097a563d Tweak SSE emitter a bit so that it handles empty responses
An empty response should either be empty or complete JSON. I went
for the latter.
2017-03-08 15:02:35 +00:00
Dave Syer
0c4dcfaf72 Fix bug in response when JSON is empty 2017-03-07 16:54:34 +00:00
markfisher
1dc0489c23 introspect bean definition for Flux types
non-Flux Functions wrapped during auto-config
2017-03-02 10:53:21 -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
d6a4ccf001 Update thin launcher to snapshot for fixes 2017-02-23 14:50:48 +00:00
markfisher
2075c649a5 add null check in FunctionController 2017-02-06 15:41:19 -05:00
markfisher
e389560967 make constructor arg MediaType property final 2017-01-23 08:44:58 -05:00
Dave Syer
425be34b98 Send content type to web response if available 2017-01-23 09:37:02 +00:00
Dave Syer
946f4a3bf3 Fix HTTP responses that caller asked to be JSON
If caller says he accepts application/json we need to be sure that
we send an array. That wasn't quite working and hadn't been tested.
2017-01-20 13:54:23 -05:00
Dave Syer
452106f287 Fix some logic with media types
If user sends "Accept: */*" we don't want to default to sending
an SSE (for instance). So the logic for detecting those preferences
has to take MediaType.ALL into account as a special case.
2017-01-20 13:10:57 +00:00
markfisher
94a78bdc7f add Function compiling webapp and update scripts 2017-01-19 15:55:49 -05:00
Dave Syer
5c79ff58a6 Workaround bug in thin launcher that brings in wrong reactor version 2017-01-12 21:27:38 -05:00
Dave Syer
216e5c9207 Add MVC body processors to handle Flux
We don't need to cover all the possible uses of Flux (only
Flux<String> really), so this isn't comprehensive coverage of
all the features in Spring WebFlux, but it's good enough for
functions to run with Spring Boot 1.5.
2017-01-12 08:55:46 -05:00
markfisher
0fb31d6d2b removed FunctionRegistry 2017-01-11 21:23:02 -05:00
markfisher
cfd416590d removing FileSystemFunctionRegistry 2017-01-11 20:59:18 -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
fc9d258564 Add custom JsonObjectDecoder to extract a Flux<String> from request 2017-01-06 15:21:56 +00:00
Dave Syer
3357a93cef Add some tests for JSON mime types in rest endpoints 2017-01-06 14:11:48 +00: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
5be3a3b08a Use Spring Boot Web Reactive instead of raw netty 2017-01-03 15:16: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
Dave Syer
7bcafabd20 Fix for another API change 2016-12-16 10:38:40 +00:00
Dave Syer
3ce376937e Update to latest reactor-netty stack 2016-12-14 14:48:38 +00: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
59376bbb0e initial web support 2016-09-22 11:59:31 -04:00