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, receiveTimeout 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.Stringcronjava.lang.StringerrorChanneljava.lang.StringfixedDelayjava.lang.StringfixedRatejava.lang.StringmaxMessagesPerPolljava.lang.StringreceiveTimeoutOnly applies to polling consumers.java.lang.StringtaskExecutorjava.lang.Stringtriggerjava.lang.Stringvalue
-
Element Details
-
value
java.lang.String value- Returns:
- The
PollerMetadatabean name.
- Default:
- ""
-
trigger
java.lang.String trigger- Returns:
- The
Triggerbean name.
- Default:
- ""
-
taskExecutor
java.lang.String taskExecutor- Returns:
- The
TaskExecutorbean 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
PeriodicTriggerwithfixedRate. 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 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 or not 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:
- ""
-