Commit Graph

167 Commits

Author SHA1 Message Date
Oleg Zhurakousky
85000ee084 GH-460 Add support for function filtering
Added support for function filtering in the event there are more then one function in catalog. This is primarily to ensure that
we have a mechanism to specify which functions to export as web enpoints (instead of all)

Resolves #460
2020-03-23 11:19:40 +01:00
Oleg Zhurakousky
919b9902e9 Improved handling of output Message conversion
remove the check for 'accept' header
added test

Resolves #465
2020-03-18 17:01:55 +01:00
Eric Bottard
b28c7c5cfc Add a test for accept being multi-valued and tested in order 2020-03-18 16:59:09 +01:00
Oleg Zhurakousky
fb095f7ac3 Improve output type conversion handling
- Re-enable, clean and improve  special handling for collection/array output type
- Add tests to validate and demonstrate the differences in  special handling of collection of Messages ve collection of non-Messages

Resolves #464
2020-03-18 15:50:55 +01:00
Eric Bottard
b1d9890e0c Don't treat byte[] or collections in a special way. 2020-03-18 13:59:21 +01:00
Oleg Zhurakousky
0acff2b1d3 Enhancements to content-type negotiation
- Added logic to wrap custom (user) message converters with NegotiatingMessageConverterWrapper
- Removed 'addDefaultConverters' flag from ContextFunctionCatalogAutoConfiguration as it is more confusing then useful
- Added test which uses wild card accept content-type with several converters available to ensure the appropriate one is used
- Made NegotiatingMessageConverterWrapper package private and moved it and it's test to a contex.config package

Resolves #462
2020-03-18 11:15:03 +01:00
Florent Biville
046913de99 Add tests to NegotiatingMessageConverterWrapper 2020-03-18 11:05:16 +01:00
Oleg Zhurakousky
b71c793dab GH-458 Remove default dependency on ApplicationJsonMessageMarshallingConverter
Resolves #458
2020-03-10 16:13:28 +01:00
Oleg Zhurakousky
2b4f8c7958 Clean up FunctionTypeUtils.isOfType method 2020-03-02 09:55:45 +01:00
Oleg Zhurakousky
f4530e0d89 Fix to-Message conversion logic
Fixed  logic to ensure that for cases where user may return a Message with no contentType set, the property-set content type is propagated
2020-02-22 08:24:27 +01:00
Oleg Zhurakousky
313f10946d GH-439 Fixed main class discovery
The regression was caused by filtering main classes that are @SpringVootApplication only, essentially excluding @SpringBootConfiguration

Resolves #439
2020-01-29 18:38:09 +01:00
Oleg Zhurakousky
d334ed609c GH-444 Fixed support for default function lookup
Given that function can be looked up with no definition, the fallback alternative should be 'spring.cloud.function.definition' property

Resolves #444
2020-01-28 15:50:42 +01:00
Oleg Zhurakousky
35d3c45959 GH-1896Stream Fixed conversion of collection of messages 2020-01-27 17:25:21 +01:00
Oleg Zhurakousky
52b0fdea50 GH-434 Added generic FunctionInvoker for AWS
- Added generic FunctionInvoker capable of handling the request generically without requiring user to implemen specific AWS request handler

Resolves #434
2019-12-16 14:27:41 +01:00
Oleg Zhurakousky
a0f072a11d GH-429 Fixed logic behind 'composed' flag
Fixed and simplified logic behind 'composed' flag in FunctionInvocationWrapper and added additional test

Resolves #429
2019-12-06 09:27:22 +01:00
Oleg Zhurakousky
00ec268aca GH-420 Fix discovery of function type from class
Fix introspection over ScannedGenericBeanDefinition

Resolves #420
2019-10-29 19:50:39 +01:00
Oleg Zhurakousky
52f1f04020 GH-395 Add support for non-message json to be converted as POJO
Resolves #395
2019-10-01 14:06:17 -04:00
Oleg Zhurakousky
97bea81836 Discover function type from FactoryBean
* Fix spring-integration sample

* Added discoverFunctionTypeFromClass() method to FunctionTypeUtils

* A `FactoryBean` may produce a function instance as well.
Add a logic into `BeanFactoryAwareFunctionRegistry` to discover a function type from the `FactoryBean.getObjectType()`
2019-09-25 10:24:07 -04:00
Oleg Zhurakousky
11a6e923ee GH-409 Fix default discovery of functions
Fixed discovery of functions to ensure that even in cases where default function is found but it's type can not be determined such function is discarded. This effectively ensures that if the actual instance does not match the declared type such function is not treated as function.

Resolves #409
2019-09-22 17:15:19 -04:00
Oleg Zhurakousky
9011615c30 Minor enhancements and polishing to accomodate s-c-stream requirements for multi-in/out bindings 2019-09-17 17:53:54 +02:00
Oleg Zhurakousky
2aed5abff8 GH-408 Enhance RoutingFunction with SpEL and application properties
- Added initial support for communicating routing instructions via SpEL thru both message headers and application properties
- Added support for communication function definition via application properties
- Added additional tests and updated documentation

Resolves #408
2019-09-10 09:25:40 +02:00
Oleg Zhurakousky
992c70762e GH-381 Add tests to validate lazy initialization effect
Resolves #381
2019-09-04 18:42:01 +02:00
Oleg Zhurakousky
7611cba69e GH-387 Added initial support for flexible function signatures
- Added support for simple POJO functions
- Added additional utility methods
2019-08-22 16:58:18 +02:00
Oleg Zhurakousky
591b3bf531 Fixed README generation and polished few tests 2019-08-19 17:08:12 +02:00
Oleg Zhurakousky
90c69368c2 Removed FunctionCatalog, BeanFactoryFunctionCatalogTests, ContextFunctionPostProcessorTests
Deprecated FluxWrapperDetector
Clean up and polishing of new BeanFactoryAwareFunctionRegistry
2019-07-30 09:06:34 +02:00
Oleg Zhurakousky
f5cf937985 Fixed output conversion for Message<byte[]> functions
- cleaned up BeanFactoryAwareFunctionRegistry
- Added javadoc to FunctionCatalog.lookup(String functionDefinition, String... acceptedOutputMimeTypes)
2019-07-27 12:41:07 +02:00
Oleg Zhurakousky
243cf95eca GH-388 Adding utility to interogate Function types
- refactoring of BeanFactoryAwareFunctionRegistry to eliminate the need for FunctionType as it takes certain assumptions that are no longer valid
- adding support for multiple acceptedOutputTypes to FunctionCatalog

Resolves #388
2019-07-24 12:12:52 +02:00
Oleg Zhurakousky
fbeee8bc37 Renamed new registry implementation to BeanFactoryAwareFunctionRegistry
- added initila javadoc
- polished few tests
2019-07-17 14:48:05 +02:00
Oleg Zhurakousky
93f7a248a5 Added initial support for lazy style FunctionCatalog/Registry which:
-  does not rely on any of the existing wrappers and instead relies on internal wrapper which performs  in-flight/just-in-time wrapping and unwrapping from reactive to imperative types
- performs transparent type conversion relying on MessageConverters and ConversionService
- supports multiple inputs/outputs
2019-07-17 13:54:02 +02:00
Oleg Zhurakousky
1cf42f95f6 GH-383 Ensure FunctionType retains ParameterizedType as 'type' filed
Resolves #383
2019-07-12 17:06:50 +02:00
Dave Syer
57689755f2 Add support for spring.cloud.function.scan.packages in functional
Fixes gh-372
2019-06-06 16:40:17 +01:00
Oleg Zhurakousky
cb952648b3 Revert "GH-355 Added support for deffered initialization of Function Catalog"
This reverts commit cd0ca2f7dc.
2019-05-01 04:48:21 +02:00
Oleg Zhurakousky
cd0ca2f7dc GH-355 Added support for deffered initialization of Function Catalog
Resolves #355
2019-04-11 16:55:16 +02:00
Walliee
5256ee177c Fix BeanFactoryFunctionCatalog initialization when a
BeanFactoryPostProcessor that depends on FunctionCatalog is present.

On application context refresh, BeanFactoryPostProcessors are
invoked before registering BeanPostProcessor(s).
If a BeanFactoryPostProcessor that depends on FunctionCatalog is present,
then when ContextFunctionCatalogAutoConfiguration tries to fetch
all functional beans (Function/Supplier/Consumer), the creation of beans
where no default constructor exists fails as
AutowiredAnnotationBeanPostProcessor hasn't been registered yet.

Initialing BeanFactoryFunctionCatalog on ApplicationReadyEvent
delays the collection of functional beans to an even later point in
the lifecycle.

fixes #352

Fix test name

Switch to use SmartInitializingSingleton

Resolves #353
2019-04-11 16:53:13 +02:00
Oleg Zhurakousky
085204bad2 Miscellaneous clean up, refactoring
Simplified FunctionCatalog structure by no longer registering the actual target function since it is available in wrapper anyway.
Cleaned up logic in RequestProcessor
2019-04-03 20:33:04 +02:00
Oleg Zhurakousky
57ae22adb9 GH-350 Fixed NPE due to missing main class
Fixed NPE due to the missing main class - a condition that could be cause my missconfiguration
Added additional assertions
Added more descriptive error message
Added MAIN_CLASS system property to the search path
Added tests

Resolves #350
2019-04-02 09:02:08 +02:00
Oleg Zhurakousky
210d9ad431 Added additional test and polished HybridFunctionalRegistrationTests 2019-04-01 14:30:11 +02:00
Spring Operator
3b573c27ac URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 247 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-21 12:48:58 -05:00
Oleg Zhurakousky
87a878879c GH-293 Enhanced endpoint mapping support for functional form context configuration
- Enhanced HTTP endpoint mapping support for 'functional form' context configuration ensuring it can register multiple endpoint to maintain the same behaviour as with regular application context
- Additional consolidation around Function Catalog
- Added identical test for functional and non-functional form endpoint configuration.

Resolves #293
2019-03-19 08:17:13 +01:00
Oleg Zhurakousky
5b18fd7b3c Simplified support for implicit functions in composition
added test for namless Supplier | Function
2019-02-28 22:23:02 +01:00
Dave Syer
8d834a7483 Support for implicit functions in composition
If there is only one function then empty String can be used as a
name to look it up.
2019-02-28 10:05:13 -05:00
Oleg Zhurakousky
b48c7b5dc0 Added initial implementation of check for supported function signatures 2019-02-28 15:41:04 +01:00
Dave Syer
41f66e9b48 Fix checkstyle and compiler errors 2019-02-25 15:15:35 +00:00
Dave Syer
32987230c1 Add support for composing function of Message with plain function
Fixes gh-267 at least for the most common cases.
2019-02-25 13:53:29 +00:00
Oleg Zhurakousky
0189c578ef GH-266 Consolidated Adapter infrastructure
- Moved common logic into a new AbstractSpringFunctionAdapterInitializer
- Modified Azure and AWS request handlers to extend from it
- Deprecated both AzureSpringFunctionInitializer and SpringFunctionInitializer(AWS)

Resolves #266
2019-02-25 13:25:08 +01:00
Dave Syer
155d76b1a5 Ensure function types and names are registered in memory 2019-02-21 17:39:24 +00:00
Dave Syer
aaf268ea40 Ensure FunctionTypes get registered for composite functions
Without this change the type of a composed function in the
InMemoryFunctionCatalog is always null. The key is to register
the type at the same time as the function is registered.

Also some format and javadoc fixes (cosmetic)
2019-02-21 09:53:15 +00:00
Oleg Zhurakousky
0d7e0cc57c GH-261 Added support for function composition InMemoryFunctionCatalog
- Refactored InMemoryFunctionCatalog and BeanFactoryFunctionCatalog into common catalog implementation
- Added initial test

Resolves #261
2019-02-18 22:05:19 +01:00
Oleg Zhurakousky
94106dba48 GH-258 Polishing around duplicqte registration
Removwd formatter plugin
Added additional test

Resolves #258
Resolves #259
2019-02-15 10:15:13 +01:00
Oleg Zhurakousky
805b85b102 GH-243, GH-257 Added reactive consumer wrapper
- Added wrapper for an already reactive consumer to ensure that consumers can be consistently represented as Function<Flux, Mono>
- Fixed the big that deal with inconsistent result in web environments due to inconsistent representation of the Consumers
- Polished tests

Resolves #243
Resolves #257
2019-02-11 15:30:08 +01:00