Commit Graph

96 Commits

Author SHA1 Message Date
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
Oleg Zhurakousky
6a2717a580 Tidy up ContextFunctionCatalog 2019-02-05 23:03:46 +01:00
Marcin Grzejszczak
c6ddfe1af4 Added checkstyle for tests 2019-02-03 15:34:10 +01:00
Marcin Grzejszczak
e4b08a083c Turned on checkstyle 2019-02-01 15:48:32 +01:00
Oleg Zhurakousky
d89835bd80 GH-232 Removed FunctionScan annotation
Reoved FunctionScan annotation since it provides no additional value to the end user
Preserved auto component scanning for Functions in  package
Updated filter to additionally scan for Supplier and Consumer

Resolves #232
2018-12-03 17:29:16 +01:00
Oleg Zhurakousky
6a16a44aa0 GH-235 Moved Kotlin support to a separate module
Resolves #235
2018-11-30 18:48:32 +01:00
Dave Syer
8cce006b4c Remove dependency on Kotlin for tests
The Eclipse tooling keeps flaking out and refuses to work at all
since 0.8.7. Maybe revisit this when it is stable.
2018-11-16 17:19:19 +00:00
Oleg Zhurakousky
8eb7e06e02 GH-227 Moved Kotlin transformation to BFPP
resolves #227
2018-10-31 16:59:53 +01:00
Oleg Zhurakousky
880333d394 GH-224 Added kotlin/java func composition test
Added test to make ure that Kotlin and Java functions are composable
Resolves #224
2018-10-26 16:16:57 +02:00
Oleg Zhurakousky
2e5c6d22b5 Added support for input Collection param
Added support for function parameter type Collection
Updated both Jackson and Gson mappers
Defined a new toObject() operation on JsonMapper and deprecated the old

Resolves #210
2018-10-25 12:47:41 +01:00
Dave Syer
54deae5dba Ensure FunctionalSpringApplication works with String sources 2018-10-23 14:03:43 +01:00
Oleg Zhurakousky
af717e445d Polishing
Resolves #219
2018-10-22 14:26:59 +02:00
Dave Syer
ba34d4b81b Add @FunctionalSpringBootTest and mini web server
User can run a minimal HTTP app using an app that is a Function
or an ApplicationContextInitializer. Can also test using
@FunctionalSpringBootTest in place of @SpringBootTest.

Add some tests and documentation for functional beans

Make server.address configurable
2018-10-22 14:26:17 +02:00
Dave Syer
c4ee7ab065 Add other annotation processors to functional context 2018-10-18 09:36:43 +01:00
Oleg Zhurakousky
ae07a13d03 GH-56 Added support for Function<Flux, Mono> and <Mono, Flux>
Resolves #56
Resolves #218
2018-10-17 21:14:27 -04:00
Oleg Zhurakousky
31e689b108 GH-208 polishing ec68f64 commit
Ensured that the composed Supplier is of type Mono<Void>
Fix tests
2018-10-14 20:29:13 -04:00
Oleg Zhurakousky
8c2fdfd193 GH-198 added multi-function validation test
Added test to validate that the behavior described in GH-198 is intentional and useful especially in light og GH-208
Resolves #198
2018-10-14 19:43:36 -04:00
Oleg Zhurakousky
ec68f6453c GH-208 Added support for composing Supplier and Consumer
This essentially returns a terminal Supplier - Supplier<Flux<Void>> which can no longer be composed with anything else
Resolves #208
2018-10-14 19:29:23 -04:00
Dave Syer
083d5e3bf3 Harmonize AWS and azure adapters 2018-10-12 17:10:13 +01:00
Andy Clement
2f9e4bb015 Adjust how classpath computed in test, for compatibility with Java 9+ 2018-10-09 17:11:26 -07:00
Oleg Zhurakousky
c43f081ef1 Cleanup and added more tests 2018-09-19 14:33:01 +02:00
Dave Syer
3c91914f82 Purge some more deprecated constructor usages 2018-09-17 15:21:40 +01:00