INT-3887: Add receiveTimeout into the @Poller

JIRA: https://jira.spring.io/browse/INT-3887
This commit is contained in:
Artem Bilan
2018-10-25 16:07:24 -04:00
committed by Gary Russell
parent 13f9ab6da8
commit 7702a6f89e
6 changed files with 42 additions and 11 deletions

View File

@@ -445,7 +445,8 @@ public class AnnotationService {
The `@Poller` annotation provides only simple `PollerMetadata` options.
You can configure the `@Poller` annotation's attributes (`maxMessagesPerPoll`, `fixedDelay`, `fixedRate`, and `cron`) with property placeholders.
If it is necessary to provide more polling options (for example, `transaction`, `advice-chain`, `error-handler`, and others), you should configure the `PollerMetadata` as a generic bean and use its bean name as the `@Poller`'s `value` attribute.
Also, starting with version 5.1, the `receiveTimeout` option for `PollingConsumer` s is also provided.
If it is necessary to provide more polling options (for example, `transaction`, `advice-chain`, `error-handler`, and others), you should configure the `PollerMetadata` as a generic bean and use its bean name as the `@Poller` 's `value` attribute.
In this case, no other attributes are allowed (they must be specified on the `PollerMetadata` bean).
Note, if `inputChannel` is a `PollableChannel` and no `@Poller` is configured, the default `PollerMetadata` is used (if it is present in the application context).
To declare the default poller by using a `@Configuration` annotation, use code similar to the following example:

View File

@@ -47,6 +47,7 @@ The following changes have been made in version 5.1:
* <<x5.1-publisher>>
* <<x51.-integration-graph>>
* <<x51.-global-properties>>
* <<x51.-poller-annotation>>
[[x5.1-java-dsl]]
==== Java DSL
@@ -222,8 +223,14 @@ See <<micrometer-integration>> for more information.
It is now possible to add additional properties to the `IntegrationNode` s via `Function<NamedComponent, Map<String, Object>> additionalPropertiesCallback` on the `IntegrationGraphServer`.
See <<integration-graph>> for more information.
[[x51.-x51.-global-properties]]
[[x51.-global-properties]]
=== Integration Global Properties
The Integration global properties (including defaults) can now be printed in the logs, when a `DEBUG` logic level is turned on for the `org.springframework.integration` category.
See <<global-properties>> for more information.
[[x51.-poller-annotation]]
=== The `receiveTimeout` for `@Poller`
The `@Poller` annotation now provides a `receiveTimeout` option for convenience.
See <<configuration-using-poller-annotation>> for more information.