INT-3961: Add Channel Late Binding for @ICA

JIRA: https://jira.spring.io/browse/INT-3961

The `@InboundChannelAdapter` may be initialized by its `MessagingAnnotationPostProcessor` a bit earlier than the
provided channel is created and registered in the context - via some other more late `BPP`, e.g. `IntegrationFlowBeanPostProcessor` from Java DSL.

* Add channel late-binding logic to the `InboundChannelAdapterAnnotationPostProcessor` and `SourcePollingChannelAdapter` by the provided `outputChannelName` option.
* Add the `channel` alias for the `value` annotation attribute in the `@InboundChannelAdapter`
* Add the `@InboundChannelAdapter` configuration into the `EnableIntegrationTests` without the channel declaration to be sure that the fix provide the expected results without `DestinationResolutionException`
* Mention both changes in the `configuration.adoc` and `whats-new.adoc`
This commit is contained in:
Artem Bilan
2016-03-07 13:01:34 -05:00
committed by Gary Russell
parent 732990ee66
commit 1d93702b23
6 changed files with 88 additions and 16 deletions

View File

@@ -438,6 +438,14 @@ public String foo() {
}
----
Starting with _version 4.3_ the `channel` alias for the `value` annotation attribute has been introduced for better
source code readability.
Also the target `MessageChannel` bean is resolved in the `SourcePollingChannelAdapter` by the provided name
(`outputChannelName` options) on the first `receive()` call, not during
initialization phase.
It allows the 'late binding' logic, when the target `MessageChannel` bean from the consumer perspective
is created and registered a bit later than the `@InboundChannelAdapter` parsing phase.
The first example requires that the default poller has been declared elsewhere in the application context.
*@MessagingGateway*

View File

@@ -141,3 +141,10 @@ See <<amqp-message-headers>>, <<ws-message-headers>>, and <<xmpp-message-headers
Groovy scripts can now be configured with the `compile-static` hint or any other `CompilerConfiguration` options.
See <<groovy-config>> for more information.
==== @InboundChannelAdapter
The `@InboundChannelAdapter` has now an alias `channel` attribute for regular `value`.
In addition the target `SourcePollingChannelAdapter` components can now resolve the target `outputChannel` bean
from its provided name (`outputChannelName` options) in late-binding manner.
See <<annotations>> for more information.