- moved OriginalContentTypeResolver to avro module
- removed StringConvertingContentTypeResolver as it is no longer referenced anywhere
- deprecated KryoMessageConverter
Resolves#1228
- Removed spring-boot-starter-web dependency from the core
- Polished AggregateApplicationBuilder to ensure it thriows meaningful exception when web is enabled but 'spring-boot-starter-web' is not on the classpath
- fixed Aggregator tests to defualt to no-web
- added spring-boot-starter-web to schema projects
Resolves#1175
- Merged SmartJsonMessageConverter with ApplicationJsonMessageMarshallingConverter
- Fixed Tests
- Fixed SpringIntegrationChannelBinder to enforce byte[] payload type for polling delegate
- Other minor polishings
Resolves#1197
StreamListenerMethodSetupOrchestrator is an API hook that allows
downstram binder implementations or applications to inject custom
strategies to alter the default StreamListener adapter method invocations.
This PR primarily focuses on allowing customizations on the oubound side.
For the inbound, StreamListenerMethodSetupOrchestrator interface provides
a default implementation.
Corresponding refactoring in StreamListenerAnnotationBeanPostProcessor.
By default StreamListenerAnnotationBeanPostProcessor will use the current
strategies used for invoking the StreamListener adapters. If beans are provided
for orchestration, they take precedence however.
Test changes.
Further polishing in StreamListenerAnnotationBeanPostProcessor.
Resolves#1177Resolves#1179
- missing `}` in one code snippet caused syntax-highlighting problems in asciidoc-aware editors such as atom
- use spaces, not tabs for code snippets
- Change markdown to asciidoc for one snippet
Fixed support for partition properties to be Spring configured
- Fixed support for 'partitionKeyExtractor' and 'partitionSelector' to be Spring configured
- Added new producer properties 'partitionKeyExtractorName' and 'partitionSelectorName'
- Deprecated 'partitionKeyExtractorClass' and 'partitionSelectorClass' properties
- Removed InitilaizingBean from MessageConverterConfigurer
- Updated documentation
- Added additional tests
- Removed PartitionedProducerTest as redundant
- Fixed unrelated to this effort BinderPropertiesTests due to recent Boot changes
polishing
Resolves: https://github.com/spring-cloud/spring-cloud-stream/issues/1174
Introduce `PollableMessageSource` for polled consumers.
The `@Input` annotation can now be applied to interface methods returning
`PollableMessageSource` and binders that can support polled consumers
will wire up an implementation `DefaultPollableMessageSource` which can
then be `poll()`ed.
The `poll()` method takes a `MessageHandler` callback to handle any message
returned by the poll; the method returns true if a message was found and
handled, false otherwise.
By default, acknowledging the message is deferred until the message handler
returns but that auto-acknowledging can be disabled if the user wishes to
defer the acknowledgment until later. Refer to the Spring Integration
documentation for more information (internally, a `MessageSourcePollingTemplate`
is used, which performs the ack/nack when the handler exits).
Usage:
```java
public interface PolledConsumer extends Processor {
@Input("pollableSource")
PollableMessageSource pollableSource();
}
```
and
```java
@Bean
public ApplicationRunner runner(PollableMessageSource pollableSource) {
return args -> pollableSource.poll(message -> {
System.out.println("Polled payload: " + message.getPayload());
});
}
```
Polishing
Fix test; add support to test binder.
Add error channel handling and retry
More polishing driven by Rabbit implementation
- can't use the MessageSourcePollingTemplate within retry since it will fetch more messages
- populate the retry context with data for the error message strategy
Polishing - PR Comments
Fix NPE.
Revert finally in DefaultPollableMessageSource
Catch Throwable - JUnit throws Errors
Change method name to reflect it's only used for polled consumers.
Fix errors when no retry
Remove stack trace print
Fix error message strategy context with no retry
Add separate error MessageHandler for polled consumers.
Resolves#1174Resolves#1176
After changing the `propertyAccessorInjector` `BeanPostProcessor`
just to a simple `InitializingBean` there is no guarantee which bean
will be accessed from the autowire phase.
There are some cases like `@PostConstruct` on the `@Configuration`
wich may be called before this new `propertyAccessorInjector` bean
and we end up with `EvaluationContext` not supplied with additional
`PropertyAccessors`
* For proper `IntegrationEvaluationContextFactoryBean` initialization
add `SpelPropertyAccessorRegistrar` for custom `PA` configuration
* Remove `propertyAccessorInjector` bean altogether
* Resolve deprecation in the `BindingServiceConfiguration`
* Modify `SpelExpressionConverterConfigurationTests` to confirm that
even `@PostConstruct` on `@Configuration` works as expected
Resolves#1178
- added SI provided argumentResolvers to MessageHandlerMethodFactory configuration to ensure that StreamListener annotated methods are consistent with equivalent SI config annotations (e.g., ServiceActivator)
Resolves#1135
Fixes: spring-cloud/spring-cloud-stream#1170
The `messageHandlerHeaderPropagationBeanPostProcessor` causes early
`BeanFactory` initialization via its `SpringIntegrationProperties`
dependency.
This triggers an initialization all the `@ConfigurationProperties`
infrastructure in Spring Boot, when we might not have all the necessary
beans, e.g. `Converter` for some configuration property
* Eliminate the "early `BeanFactory` initialization syndrome" through
the `SmartInitializingSingleton`
**Cherry-pick to 1.3.x**
Some tests in `AbstractBinderTests` are rely on the partition header,
but that one can be populated only by the `PartitionInterceptor`.
To allow it we need to provide appropriate producer properties, like
`partitionKeyExpression`.
* Populate test-based `ProducerProperties` to the
`createBindableChannel()` where `PartitionInterceptor` is populated
* Fix `checkstyle.xml` static imports rule for Mockito-2.x as the
current base line
Fix for the proper `BindingProperties` usage
Fixes: spring-cloud/spring-cloud-stream#1159
* Extract `EmbeddedHeadersChannelInterceptor` class for better navigation
* Use only one shared instance of this interceptor since it is stateless
* Add this `EmbeddedHeadersChannelInterceptor` in the position `0` to
extract embedded headers first
The fix confirmed by Kafka and Kinesis binders
- Deprecated BindableAdapter in favor of providing default operations in Bindable
- Removed 'postProcessBeforeInitialization(..)' from 'BinderAwareRouterBeanPostProcessor' as it is no longer required
Continue the work started in f53ff9585a
- simplified 'isDeclarativeMethodParameter(..) operation of StreamListenerAnnotationBeanPostProcessor
- aligned MessageChannelToInputFluxParameterAdapter and MessageChannelToInputObservableParameterAdapter around the actual Message
- Removed dependency and callbacks to 'BeanFactoryUtils.beansOfTypeIncludingAncestors' in
StreamListenerAnnotationBeanPostProcessor in favor of more appropriate and lazy DI
mechanism provided by Spring.
- Polishing