Commit Graph

24 Commits

Author SHA1 Message Date
Dave Syer
998ea3ad35 Fix and test bug with generic input or output types
Without this fix a Function<Foo<Bar>,...> shows as having an
input type of Bar - we need to only take the parameter if the
raw type is Flux.
2017-05-22 13:27:49 +01:00
Dave Syer
69c22482d1 Add more subtle content negotiation in web layer
So that single Strings can be POSTed without JSON conversion.
There's still some work to do to support single POJOs in JSON, and
to reach parity with the WebFlux reactive type handlers, but it's
now closer to what we had before we moved the String conversion
out of the function layer.
2017-05-05 09:22:23 +01:00
Dave Syer
39ca7952b9 Fix some tests
There is one behaviour change (you have to POST an array to a function
endpoint if you are sending a body), and also a message converter that
needed to be removed so that arrays are not toStringed in the response
body.
2017-04-25 08:51:31 +01:00
Dave Syer
4686e450b1 Alternative approach to MVC handling
Doesn't rely on manipulating the FunctionCatalog, and does type
conversion/coercion in the MVC layer.
2017-04-24 16:31:09 +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
d67159729d Add support for explicit FunctionRegistration
A bean of type FunctionRegistration registers the function with
user-specified name and other properties, rather than relying on the
bean name.

Alternatively, function catalog keys can be specified as a
@Qualifier, which will be used instead of the bean name if
no registration is found.
2017-04-04 10:24:54 -04:00
markfisher
0b49edc2fd polishing 2017-03-31 11:43:28 -04: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
cadd5546da Add custom HandlerMapping to allow more flexible request mapping 2017-03-31 13:44:11 +01:00
Dave Syer
5ace9b764b Resort to reflection if the function is not a @Bean
Beans that are not created from a @Bean factory method do not have
the same kind of metadata. This change uses relection to extract
the target type from the bean definition if all else fails.
2017-03-10 17:40:05 +00: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
markfisher
1dc0489c23 introspect bean definition for Flux types
non-Flux Functions wrapped during auto-config
2017-03-02 10:53:21 -05:00
markfisher
b4c37f7828 added FunctionScan annotation 2017-02-20 12:20:42 -05:00
markfisher
0a6dce951b add support for function composition 2017-02-06 15:55:53 -05:00
markfisher
cc3bb8f645 renamed ApplicationContextFunctionCatalog 2017-01-13 10:45:07 -05:00
markfisher
cfd416590d removing FileSystemFunctionRegistry 2017-01-11 20:59:18 -05:00
Dave Syer
b3750cdfa5 Check for simple String inputs and don't convert them 2017-01-10 15:27:42 -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
3357a93cef Add some tests for JSON mime types in rest endpoints 2017-01-06 14:11:48 +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
13774abe39 Remove unnecessary parameters 2017-01-04 09:34:09 +00:00
Dave Syer
80408d2f77 Add support for consumers and factor out base class 2017-01-04 09:30:23 +00:00
Dave Syer
f8a5f02be3 Add POJO sample and switch to using that for testing 2017-01-03 17:48:57 +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