Commit Graph

31 Commits

Author SHA1 Message Date
Oleg Zhurakousky
bb1a94bfe8 GH-1600 Java 11 compatibility fixes
Added explicit dependency declarations for missing javax.* packages
Fixed compile errors in affected classes

Resolves #1600
2019-06-05 16:48:30 +02:00
Oleg Zhurakousky
db817b850d Polishing, fixing check styles 2019-06-05 09:24:52 +02:00
Ryan Dunckel
bc1787310e passes a conversion hint to the message converter to support nested generics. Fixes #1723
Resolves #1725
2019-06-05 09:24:05 +02:00
Oleg Zhurakousky
c6385f220c Upgraded master to 3.0.0
bumped s-c-build to 2.2
fixed tests related to boot 2.2 changes
2019-05-28 13:24:22 +02:00
Oleg Zhurakousky
b5a64eac14 Fixed URLs in licence headers and upgraded to s-c-build 2.1.4 2019-03-25 15:24:18 +01:00
Marcin Grzejszczak
a8cbf77794 Added checkstyle 2019-02-04 15:55:35 +01:00
Soby Chacko
ae445e73ac Spring Boot 2.1 upgrade related changes
* Instead of redefining `BinderTypeRegistry` as a bean in several tests, properly use spring.binders
  to define mock binders and then choose a default binder in tests in case of multiple binders in
  same spring.binders file.
* Remove `BindingServiceConfiguration` in `EnableBinding` and introduce it as a proper
  Spring Boot autoconfiguration class. Added `BindingServiceConfiguration` to spring.factories.
* Move `BinderFactory` bean into `BindingServiceConfiguration` and add `ConditionalOnMissingBean`
  on it so that downstream users can define new `BinderFactory` beans as part of autoconfiguration.
* Remove `ConditionalOnMissingBean` from the `BinderTypeRegistry` bean in `BinderFactoryConfiguration`
  as we don't expect this bean to be overridden.
* Remove previously added property `spring.main.allow-bean-definition-overriding` in several tests.
* Since web/actuator is optional now, remove unncecessarily setting server.port to `0` in tests
* Ensure that `BindersHealthIndicatorAutoConfiguration` is autoconfigured after `BindingServiceConfiguration`
  so that it has a `BinderFactory` available.
* Remove redefining `ServerController` bean in `SchemaServerConfiguration` as this is already created through
  component scanning and causing the bean overriding exceptions.
* Tests cleanup and polishing.

Resolves #1429, #1430
2018-08-10 11:27:11 -04:00
Soby Chacko
cb105ab0ec Upgrade Spring Cloud Build to 2.1.0
This upgrades to Spring Boot 2.1.0
Fix tests where the beans need to get overridden
Minor cleaning up
Polishing

Resolves #1426
2018-08-07 19:47:13 +02:00
jmaxwell
e3393b98ca GH-1301 Add conversion to Flux Message Payload.
Resolves #1301
Resolves #1302
2018-06-25 23:09:29 -04:00
Soby Chacko
624a25fc92 Remove RxJava components from the reactive module
Remove all the deprecated RxJava components from spring-cloud-stream-reactive module in favor
of using Project Reactor based types.

Fixes #1378
Resolves #1379
2018-05-15 15:26:34 +02:00
Soby Chacko
9556fc5ffc Deprecating RxJava components in the reactive module
Resolves #1317
Resolves #1320
2018-03-21 12:50:25 -04:00
Oleg Zhurakousky
c76c29f249 Aligned StreamEmitterAnnotationBeanPostProcessor with StreamListenerAnnotationBeanPostProcessor
. . .as part of the effort to fix early initialization of beans inside BeanPostProcessors.

Resolves #1157
2018-01-03 21:46:40 -05:00
Oleg Zhurakousky
7b5bb2f463 StreamListenerAnnotationBeanPostProcessor refactoring/polishing
Continue the work started in f53ff9585a
- simplified 'isDeclarativeMethodParameter(..) operation of StreamListenerAnnotationBeanPostProcessor
- aligned MessageChannelToInputFluxParameterAdapter and MessageChannelToInputObservableParameterAdapter around the actual Message
2017-11-28 14:58:15 -05:00
Oleg Zhurakousky
a7fdf6dbb2 GH-1106 Addressed backward/forward contentType compatibility issues
Fixes #1106

- This PR builds on the previous PR with commit hash 6c259be6... (pr/1112)
- Added support in AbstractBinderTests to create bindable channel based on determining channel input type based on it's name (i.e., *input*)
- Added LegacyContentTypeHeaderInterceptor to TestSupportBinder to restor the previous behavior of MessageCollector for cases
  where Message's payload content type is a variant of 'text'.
- Restored tests that use MessageCollector to depend on proper payload type
- Added 'deserialize' routine back to MessageSerializationUtils
- Polished MessageConverterConfigurer.LegacyContentTypeHeaderInterceptor to remove conditional original-content-type header logic
- Removed default contentType from BindingProperties
- Restored tests that use MessageCollector to depend on proper payload type
- polishing
- fixed Kryo/Java serialization
- Fixed ser/de for "application/json" and contentType equals
- Fixed of ser/de of JSON strings to ensure that Strings are not re-quoted
- Fixed how we comparing contentTypes
- more polishing
- Fixed NPE in MessageSerializationUtils
- Make bindings and consumer groups in new tests added to AbstractBinderTests mutually exclusive
2017-11-07 11:21:13 -05:00
Vinicius Carvalho
171f034a8c Content type redesign
Fixes #992, #1050, #1051, #1052

Adding custom jackson converter with some tests
Adds kryo message converter to replace codec
Checkstyle changes

Removing codec support
- Removed codec dependency from AbstractBinder
- MessageSerializationUtils is almost an empty shell for now, just to
  keep code compiling until we get EmbeddedHeaders interceptors
- Updated Kryo tests

Removing codec module from build
Added a new Annotation for custom converters '@StreamConverter'
Fixed some tests with new expected behavior
Moved broken tests to a temporary package to keep track of progress
Fixed KryoConverter to fail based on headers
Fixed a couple of more tests

Making converters strict to only convert their corresponding contentType
Bypassing conversion for ErrorMessages

* Configuring SI ConfigurableCompositeMessageConverter
 - Moved ContentType related beans into separate configuration
 - Configured SI ConfigurableCompositeMessageConverter to use same
   converters as Stream does (for ServiceActivator)
- TupleConverter should return byte[] as all other converters
- Fixed tests

* Fixes tests
 - Revert to Boot 2.0.0.M3. Snapshots breaking actuator
 - Checkstyle fixes
 - Disable JsonUnmarshalling as a catch all converter

Fixing Schema tests
Fixing Metrics tests
Fixing reactive tests
applying checkstyle fixes

 * Adding new content type tests
 - Fixed ContentTypeInterceptor misusage of default mimeType

Changing contentType doc section
Improving doc section
Last minute polish
Fixing BinderTests to use bytes to compare messages
Applied changes to Base Binders test to use the new contentType handling mechanism
PR review fixes

Renaming StreamConverter -> StreamMessageConverter
2017-10-05 10:35:51 -04:00
Marius Bogoevici
7260eaacab Use Reactor version managed by Boot 2017-10-05 10:31:09 -04:00
Vinicius Carvalho
bc7f794112 Upgrading to reactor core 3.1.0
- replaced setCancellation -> onDispose on FluxSink
 - replaced Flux.intervalMillis -> Flux.interval(Duration) in tests

Moving reactor dependency to release train
2017-07-17 09:45:12 -04:00
Soby Chacko
c3246f3257 GH-722: Add support for Reactive Sources
Fixes spring-cloud/spring-cloud-stream#722

Addressing PR review comments

Further addressing PR review comments
Degenericizing `StreamListenerResultAdapter` with the 3rd generic argument
added for returning `Disposable` `StreamListenerResultAdapter` adapt method
now returns `java.io.Closeable`

Addressing PR review comments

Addressing PR review comments

Converting `FluxToMessageChannelResultAdapter` to `PublisherToMessageChannelResultAdapter`

Add `logback.xml` for reactive tests

* Revert `AopUtils.getTargetClass(bean)` to really deal with target classes only.
Although it does not make any effect on the `@Configuration` classes
* Use `AnnotatedElementUtils.isAnnotated()` instead of `getMergedAnnotation()`
to avoid synthetic methods in the `@Configuration` classes
* Add artificial `.transform()` to the `IntegrationFlow` test to overcome
SI Java DSL bug
* Apply similar `.map()` for `Flux` tests configs for proper assertions

* Simple code style polishing
2017-06-21 13:15:14 -04:00
Ilayaperumal Gopinathan
bd002e4aaf Add code formatting guidelines
Add 'eclipse' folder containing Eclipse code
formatter configuration and instructions how to use
 it.

Update rule for join_wrapped_lines

 - Set to `false`

Resolves #930

Update README

Address review comments
2017-05-15 13:03:45 -04:00
Ilayaperumal Gopinathan
8792423abc Not enforcing EnableAutoConfiguration on aggregate parent
- The aggregate parent configuration now imports the required auto configuration classes such as ChannelBindingAutoConfiguration and EndpointAutoConfiguration
while `@EnableBinding` is still at the parent configuration to be able to share the binding configuration among the child applications
 - Add `ConditionalOnMissingBean` in spring cloud stream auto configuration classes so that if `EnableAutoConfiguration` is enabled at child application classes
they don't get instantiated again
 - Conditionally import EmbeddedServlet auto-configuration when web environment is enabled for parent
 - Add test

Resolves #737
2017-02-16 15:48:52 +00:00
Ilayaperumal Gopinathan
503e749c19 Fix compilation issue on ObservableToMessageChannelResultAdapter
This resolves #756
2017-01-09 13:56:40 +05:30
Marius Bogoevici
2abac42eba Update to Reactor 3.0.4
Fixes #751

- Use Reactor 3.0.4.RELEASE
- Remove Scheduler implementations that were introduced for fixes
- Shade `io.reactivex:rxjava-reactive-streams` classes to replace removed RxJava1 adapter support

Signed-off-by: Marius Bogoevici <mbogoevici@pivotal.io>
2017-01-05 15:52:09 -05:00
Marius Bogoevici
2667b7be68 Make Reactive autoconfiguration conditional on BindingService 2016-12-16 09:42:26 -05:00
Marius Bogoevici
8ac71c7b57 Support flexible bound element types
Fixes #519

Introduces some internal changes to the framework allowing the use
of other types than MessageChannel/SubscribableChannel as bindable
types (e.g. Flux, Observable, KStream, etc.)

- Modify BinderFactory to allow the retrieval and lookup of a
  binder not only by name, but also by binding target type
- Subsequent changes to ChannelBindingService and tests to account
  for the modified signature
- Introduce BindingTargetFactory as the contract for creating bound
  elements
- Remove any references to chanels and bound elements and use
  'binding target' systematically across the board

Reinstate our own Checkstyle checks with a reduced set of rules so that header
  validation can be performed automatically at compile time.

Use ${project.version} for the checkstyle plugin configuration

Renaming some occurences of 'boundElement' to 'bindingTarget'

Renamed a stray occurence of 'channel'

Fix some occurences of String concatenation in the same line after reformatting
2016-12-13 13:19:13 -05:00
Marius Bogoevici
c6e0c74626 Polishing 2016-11-20 23:01:15 -05:00
Ilayaperumal Gopinathan
453a9b0c10 Align StreamListener method/parameter mappings
- Use the same mapping of method/parameters for both declarative and message handler Stream Listeners
       - Declarative mode of the StreamListener method is determined if at least one of the the method parameters is annotated with @Input or @Output with either bound elements (e.g. channels) or conversion targets from bound elements via a registered StreamListenerParameterAdapter
       - If the method is non-declarative then it is considered to be in message handler mode
       - Declarative mode now accepts @Output annotation at method level as well along with @SendTo
       - Declarative mode also accepts @Input annotation value at the method level via @StreamListener valuue.
       - Message handler mode accepts @Input annotation value at the method parameter level and @Output annotation at the method annotation level
       - Both @Output and @SendTo annotations are supported to specify the outbound target value while @SendTo is allowed only as a method level annotation
       - Add assertions on allowable use of method and parameter annotations

    - Add parameterized tests to cover all possible cases
        - Message handler tests
        - Reactor and RxJava tests

Resolves #664

Add more error handling and simplify the usage patterns

Address review comments

 - Support @Input/@Output only for declarative StreamListener methods
 - Support multiple @Output only when there is no return type in the StreamListener method
 - Add/Update tests

WIP

Refactor PR based on the review comments
2016-11-18 11:07:05 -05:00
Ilayaperumal Gopinathan
5d2860bc53 - Fix NPE for wildcard/generic type reactive stream listener @Input type
- Set argumentClass to Object when using wildcard/generic types if the StreamListener method parameter for @Input annotated type uses wildcard/generic type, then set the argumentClass to `Object.class` instead of null.

Resolves #665

Address review comments
2016-10-13 13:23:12 -04:00
Marius Bogoevici
d018cafee4 Subscribers to channel-wrapping Flux instances should broadcast
Fixes #640
2016-08-31 17:25:11 -04:00
Marius Bogoevici
512a5d9190 Use spring-cloud-build-tools for checkstyle validation 2016-08-25 15:27:28 -04:00
Marius Bogoevici
1b62be0217 Override scheduler implementations for Reactor 3.0.0
Workaround for https://github.com/reactor/reactor-core/issues/159
2016-08-25 12:13:09 -04:00
Marius Bogoevici
08d65a92bb Initial support for Reactive API
Fixes #520
Fixes #458 (for non-reactive binders)

Adds spring-cloud-stream-reactive module.
Introduces support for declarative @StreamListener and @Input and @Output annotated parameters.
Add StreamListenerArgumentAdapter and StreamListenerResultAdapter for wrapping bindable inputs
and outputs when passing arguments to declarative @StreamListener.
Adds support for using reactive types (Flux/Observable) with traditional binders.
Introduce FluxSender and ObservableSender for handling multiple streaming outputs per method.
Ensure that errors are caught and logged.

Fixing constructor assertions and Javadoc

Addressing PR comments

- rework @Input/@Output parameter validation
- renamed StreamListenerArgumentAdapter to StreamListenerParameterAdapter
- ensure that parameter direction is accounted for in the current adapters
2016-07-26 14:47:03 -04:00