From e993c0db6b7d912ec4b58a149dbd66bad9420b8f Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Tue, 25 Nov 2008 23:37:20 +0000 Subject: [PATCH] Added discussion of top-level poller elements and default poller per-context (INT-493). --- spring-integration-reference/src/endpoint.xml | 49 ++++++++++++++++--- .../src/spring-integration-reference.xml | 2 +- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/spring-integration-reference/src/endpoint.xml b/spring-integration-reference/src/endpoint.xml index 6361b9fe74..54aa8fcba9 100644 --- a/spring-integration-reference/src/endpoint.xml +++ b/spring-integration-reference/src/endpoint.xml @@ -75,7 +75,7 @@ EventDrivenConsumer consumer = new EventDrivenConsumer(channel, exampleHandler); PollingConsumer consumer = new PollingConsumer(channel, exampleHandler); - There are many other configuration options for the Polling Consumer. For example, the trigger can be provided: + There are many other configuration options for the Polling Consumer. For example, the trigger is a required property: PollingConsumer consumer = new PollingConsumer(channel, handler); @@ -139,13 +139,48 @@ consumer.setTransactionManager(txManager); 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. For example, a simple interval-based poller with a 1-second interval would be - configured like this: - -]]> + configured like this: + + + +]]> For a poller based on a Cron expression, use the "cron-trigger" child element instead: - - -]]> + + + + + ]]> + + + If the input channel is a PollableChannel, then the poller configuration is + required. Specifically, as mentioned above, the 'trigger' is a required property of the PollingConsumer class. + Therefore, if you omit the "poller" sub-element for a Polling Consumer endpoint's configuration, an Exception + will be thrown. However, it is also possible to create top-level pollers in which case only a "ref" is required: + + + + + + + ]]> + In fact, to simplify the configuration, you can define a global default poller. A single top-level poller within + an ApplicationContext may have the default attribute with a value of "true". In that case, any endpoint with a + PollableChannel for its input-channel that is defined within the same ApplicationContext and has no explicitly + configured 'poller' sub-element will use that default. + + + + + + ]]> Spring Integration also provides transaction support for the pollers so that each receive-and-forward diff --git a/spring-integration-reference/src/spring-integration-reference.xml b/spring-integration-reference/src/spring-integration-reference.xml index 4cc70b2267..8846485181 100644 --- a/spring-integration-reference/src/spring-integration-reference.xml +++ b/spring-integration-reference/src/spring-integration-reference.xml @@ -5,7 +5,7 @@ Spring Integration Reference Manual Spring Integration - 1.0.0.RC2 (Release Candidate 2) + 1.0.0