The following is the summary of changes which essentially delegate all type conversion back to MessageConverter.
The only thing remains is the `BINDER_ORIGINAL_CONTENT_TYPE` logic to ensure backward compatibility
* `MessageConverterConfigurer` was brought pretty much back to the state it was before all those questionable type conversion changes
* `BinderFactoryConfiguration` configures custom argument resolvers which will be removed as soon as https://jira.spring.io/browse/SPR-17503 is addressed.
* The two new argument resolvers, defer from their original counterparts in that they change the order of type assertion ensuring that, for example, byte[] does not match Object and would have to be sent to MessageConverter for possible conversion. These two resolvers will be removed once https://jira.spring.io/browse/SPR-17503 is addressed.
Resolves#1564Resolves#1565
- Renamed classes and package to be consistent with the intentions of this binder (e.g., TestChannelBinder, TestChannelBinderConfiguration etc)
- Added package-info.java
Resolves#1241
- moved OriginalContentTypeResolver to avro module
- removed StringConvertingContentTypeResolver as it is no longer referenced anywhere
- deprecated KryoMessageConverter
Resolves#1228
- Merged SmartJsonMessageConverter with ApplicationJsonMessageMarshallingConverter
- Fixed Tests
- Fixed SpringIntegrationChannelBinder to enforce byte[] payload type for polling delegate
- Other minor polishings
Resolves#1197
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
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