Resolvesspring-cloud/spring-cloud-stream#1083
By default Spring Framework allows beans overriding via the same name.
The binding target definitions (`@Input` and `@Output`) populate beans as well
and when we use the same name for target we end up with unexpected behavior
but without errors.
Since it isn't so obvious via Spring Framework bean definition DSLs
(XML or Java & Annotations) how to override beans with the same name,
that is absolutely easy to use the same value for `@Input` and `@Output`
definitions even in different binding interfaces.
That's hard to analyze fro the target application since mostly
`@Input` and `@Output` produce `MessageChannel` beans.
* Fail fast with the `BeanDefinitionStoreException` when we meet existing
bean definition for the same name
* Add JavaDocs to the `@Input` and `@Output` to explain that their `value`
is a bean name, as well as destination by default
Since `@EnableBinding` is `@Inherited`, the inheritor picks up it from the
super class during configuration class parsing.
The parsing process logic is such that after the root class we go to parse its
super classes, and therefore come back to the `@EnableBinding` again.
In this case we process all the `@Import`s one more time and collect them to
the root `configurationClass`.
Essentially we get a duplication for the `ImportBeanDefinitionRegistrar`s
such as `BindingBeansRegistrar`.
The last one parsed `@EnableBinding` and registers appropriate beans for the
`@Input` and `@Output`, as well as for the binding interface - `BindableProxyFactory`.
But since we have it twice in the `configurationClass` we end up with
`BeanDefinitionStoreException` mentioned before.
That's how Spring Framework works with inheritance for configuration classes
and that's may be why it allows to override beans by default
* Skip parsing `@EnableBinding` one more time if the bean definition for
binding interface is already present in the `registry`
* Fix `AggregateWithMainTest` do not process `@ComponentScan` what causes
picking up the configuration classes for children contexts in the aggregation
* Fix `testBindableProxyFactoryCaching()` do not register `Source` and `Processor`
in the same application context because both of them cause registration for the
`Source.OUTPUT` bean
Fix#1080
When class with `@StreamListener` method is proxied we end up
with the double target subscribers registration because we meet
the same method multiple times during `ReflectionUtils.doWithMethods()`
* Use `ReflectionUtils.getUniqueDeclaredMethods()` instead to extract
the list of method candidates
**Cherry-pick to 1.2.x**
* Add codecov support
Resolves#1043
* Remove unwanted service configs from travis
- Spring Cloud Stream doesn't use Redis/Kafka services as these were originally added to support their binder support in the same repo
Since we rely on the Checkstyle configs in the `spring-cloud-stream-tools`
module, we really need its artifact if we would like to use it as a
dependency for the `maven-checkstyle-plugin`.
But at the same time it is possible only if we run `package` phase.
During `compile/test` phase we don't have artifact yet and end up with
the error that no property set for Checkstyle.
* Use Checkstyle config files directly for the `maven-checkstyle-plugin`
properties.
This way we don't need any artifact to build in advance
Initial Commit for GH-916.
- register a pubsub error channel.
- register and subscribe a bridge handler to bridge it to the global error channel.
- pass the error channel to the implementation so it can wire it into the outbound endpoint.
- destroy the infrastructure when unbinding.
Javadoc Polishing
Add test case.
temp update to SI 4.3.12
GH-802 - Error Handling Documentation
Resolves#802
- Clarifies where @EnableBinding should be used
- Explains pubsub nature of @StreamListener and computing consumer of
other SI annotations
- Moved a comment in relevant section
- When binding the default BindingProperties, we use RelaxedDataBinder without any specific conversion service. This makes the `String` to SpEL `Expression` conversion failing when the producer properties such as `partitionKey/SelectorExpression` are bound.
- Update the underlying conversion service (which includes the SpELConverter via EnableBinding) into RelaxedDataBinder
- Update test
Resolves#1040
Fixes spring-cloud/spring-cloud-stream/#1028
Adding unit test to verify message conversion for error channel
Instead of directly binding on the error channel, use a bridge channel
and apply custom converters on that channel and then bind
Make corresponding test changes
renaming key used for error
Adding tests for exceptions on error channel when content type is set
Fixes#1010
Propagate headers by default.
Add a `copyHeaders` property to `@StreamListener` to allow suppression of header propagation.
Honour header propagation settings
Fixes#573
- Split TestSupportBinderAutoConfiguration into separate configs
for the binder, binderfactory and message collector.
This enables to address the testBinder as a regular binder when
autoconfiguration is disabled, and to ensure that the message
collector is available when the autoconfiguration is disabled.
- reorganize tests to use the default autoconfiguration options
- add documentation for disabling test binder autoconfiguration
Fixes#1013
- Do not recreate MessageValues if content is byte[]
- Optimize StreamListener dispatching
- avoid expression evaluation if not necessary
- use `StreamListenerMessageHandler` directly if there is only one method
Polishing - PR Comments; Move some classes to top-level; fix FinalRethrowingErrorMessageHandler so it's always the last subscriber.
Polishing - fix save handler
Polishing
Change type of `consumerProperties` to C.
Polishing
Polishing - PR Comments - Add Tests
Fixes#993
If the converter cannot convert due to a lingering content-type header, take a second
shot with the header removed.
If we still fail, throw a `MessageConversionException`.
Fixesspring-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
Add `SpringIntegrationProperties` class with
`spring.cloud.stream.integration` prefix for managing
Spring Integration properties.
Add `spring.cloud.stream.integration.messageHandlerNotPropagatedHeaders`
for controlling headers propagated by reply producing handlers.
Fix#943
Remove SI version override
Cleanup
* Simple polishing according PR comments
Fix#972
Do not throw an error when binder configurations are
processed, unless a binder configuration that references
an unknown binder type (i.e. not found on the classpath)
is actually used by an application.
This allows supporting scenarios like
http://docs.spring.io/spring-cloud-dataflow/docs/1.2.0.RELEASE/reference/htmlsingle/#dataflow-multiple-brokers
where a set of binder configurations is passed to a number
of applications that might or might not have a specific
binder type on the classpath. If a specific binder configuration
is not used by the application, it can be ignored.
polishing
Fix#965
Original implementation was getting the schema id and using it as the
version. This made deserialization fail since it would endeavor to
retrieve the schema by version using the id value.
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