Annotation Type Poller
@Target({})
@Retention(RUNTIME)
public @interface Poller
Provides the
PollerMetadata
options
for the Messaging annotations for polled endpoints. It is an analogue of the XML
<poller/>
element, but provides only simple attributes. If the
PollerMetadata
requires more options
(e.g. Transactional and other Advices) or initialDelay
etc., the
PollerMetadata
should be configured
as a generic bean and its bean name can be specified as the value
attribute of
this annotation. In that case, the other attributes are not allowed.
Non-reference attributes support Property Placeholder resolutions.
- Since:
- 4.0
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String
cron
java.lang.String
errorChannel
java.lang.String
fixedDelay
java.lang.String
fixedRate
java.lang.String
maxMessagesPerPoll
java.lang.String
receiveTimeout
Only applies to polling consumers.java.lang.String
taskExecutor
java.lang.String
trigger
java.lang.String
value
-
Element Details
-
value
java.lang.String value- Returns:
- The
PollerMetadata
bean name.
- Default:
- ""
-
trigger
java.lang.String trigger- Returns:
- The
Trigger
bean name.
- Default:
- ""
-
taskExecutor
java.lang.String taskExecutor- Returns:
- The
TaskExecutor
bean name.
- Default:
- ""
-
maxMessagesPerPoll
java.lang.String maxMessagesPerPoll- Returns:
- The maximum number of messages to receive for each poll.
Can be specified as 'property placeholder', e.g.
${poller.maxMessagesPerPoll}
. Defaults to -1 (infinity) for polling consumers and 1 for polling inbound channel adapters.
- Default:
- ""
-
fixedDelay
java.lang.String fixedDelay- Returns:
- The fixed delay in milliseconds to create the
PeriodicTrigger
. Can be specified as 'property placeholder', e.g.${poller.fixedDelay}
.
- Default:
- ""
-
fixedRate
java.lang.String fixedRate- Returns:
- The fixed rate in milliseconds to create the
PeriodicTrigger
withfixedRate
. Can be specified as 'property placeholder', e.g.${poller.fixedRate}
.
- Default:
- ""
-
cron
java.lang.String cron- Returns:
- The cron expression to create the
CronTrigger
. Can be specified as 'property placeholder', e.g.${poller.cron}
.
- Default:
- ""
-
errorChannel
java.lang.String errorChannel- Returns:
- The bean name of default error channel
for the underlying
MessagePublishingErrorHandler
. - Since:
- 4.3.3
- Default:
- ""
-
receiveTimeout
java.lang.String receiveTimeoutOnly applies to polling consumers.- Returns:
- the time the poll thread will wait after the trigger for a new message to arrive.
Defaults to 1000 (1 second).
For polled inbound channel adapters, whether the polling thread blocks
is dependent on the message source implementation.
Can be specified as 'property placeholder', e.g.
${my.poller.receiveTimeout}
. - Since:
- 5.1
- Default:
- ""
-