INT-4113: Add @Poller.errorChannel() Attribute

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

* To simplify `MessagePublishingErrorHandler` and avoid extra `PollerMetadata` beans, added the `errorChannel()` attribute to the `@Poller` annotation
* The `MessagePublishingErrorHandler` now supports the late-binding via new `defaultErrorChannelName`
* Docs about new `errorChannel()` attribute
* Some other docs polishing

Polishing

**Cherry-pick to 4.3.x**

Polishing docs according PR comments
This commit is contained in:
Artem Bilan
2016-09-27 14:52:05 -04:00
committed by Gary Russell
parent 93989a0c9b
commit 129984ec0a
8 changed files with 88 additions and 22 deletions

View File

@@ -374,7 +374,7 @@ public class AnnotationService {
This annotation provides only simple `PollerMetadata` options.
The `@Poller`'s attributes `maxMessagesPerPoll`, `fixedDelay`, `fixedRate` and `cron` can be configured with _property-placeholders_.
If it is necessary to provide more polling options (e.g. transaction, advice-chain, error-handler), the `PollerMetadata` should be configured as a generic bean with its bean name used for `@Poller`'s `value` attribute.
If it is necessary to provide more polling options (e.g. transaction, advice-chain, error-handler etc.), the `PollerMetadata` should be configured as a generic bean with its bean name used for `@Poller`'s `value` attribute.
In this case, no other attributes are allowed (they would be specified on the `PollerMetadata` bean).
Note, if `inputChannel` is `PollableChannel` and no `@Poller` is configured, the default `PollerMetadata` will be used, if it is present in the application context.
To declare the default poller using `@Configuration`, use:
@@ -424,6 +424,10 @@ public class AnnotationService {
}
----
Starting with _version 4.3.3_, the `@Poller` annotation now has the `errorChannel` attribute for easier configuration of the underlying `MessagePublishingErrorHandler`.
This attribute play the same role as `error-channel` in the `<poller>` xml component.
See <<endpoint-namespace>> for more information.
*@InboundChannelAdapter*
Starting with _version 4.0_, the `@InboundChannelAdapter` method annotation is available.

View File

@@ -152,14 +152,14 @@ For example, an _Aggregator_ waits for a number of Messages to arrive and is oft
When using the namespace configuration, you do not strictly need to know all of the details, but it still might be worth knowing that several of these components share a common base class, the `AbstractReplyProducingMessageHandler`, and it provides a `setOutputChannel(..)` method.
[[endpoint-namespace]]
==== Namespace Support
==== Endpoint Namespace Support
Throughout the reference manual, you will see specific configuration examples for endpoint elements, such as router, transformer, service-activator, and so on.
Most of these will support an _input-channel_ attribute and many will support an _output-channel_ attribute.
After being parsed, these endpoint elements produce an instance of either the `PollingConsumer` or the `EventDrivenConsumer` depending on the type of the _input-channel_ that is referenced: `PollableChannel` or `SubscribableChannel` respectively.
When the channel is pollable, then the polling behavior is determined based on the endpoint element's _poller_ sub-element and its attributes.
_Configuration_Below you find a _poller_ with all available configuration options:
In the configuration below you find a _poller_ with all available configuration options:
[source,xml]
----

View File

@@ -188,7 +188,7 @@ Alternatively, provide the host, username, and password:
----
NOTE: Keep in mind, as with any outbound Channel Adapter, if the referenced channel is a `PollableChannel`,
a `<poller>` sub-element should be provided (see ).
a `<poller>` sub-element should be provided (see <<endpoint-namespace>>).
When using the namespace support, a _header-enricher_ Message Transformer is also available.
This simplifies the application of the headers mentioned above to any Message prior to sending to the Mail Outbound Channel Adapter.

View File

@@ -15,6 +15,9 @@ development process.
==== Core Changes
The `@Poller` annotation now has the `errorChannel` attribute for easier configuration of the underlying `MessagePublishingErrorHandler`.
See <<annotations>> for more information.
==== JMS Changes
Previously, Spring Integration JMS XML configuration used a default bean name `connectionFactory` for the JMS Connection Factory, allowing the property to be omitted from component definitions.