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
Author:
Artem Bilan, Gary Russell
  • Element Details

    • value

      String value
      Returns:
      The PollerMetadata bean name.
      Default:
      ""
    • trigger

      String trigger
      Returns:
      The Trigger bean name.
      Default:
      ""
    • taskExecutor

      String taskExecutor
      Returns:
      The TaskExecutor bean name.
      Default:
      ""
    • maxMessagesPerPoll

      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

      String fixedDelay
      Returns:
      The fixed delay in milliseconds to create the PeriodicTrigger. Can be specified as 'property placeholder', e.g. ${poller.fixedDelay}.
      Default:
      ""
    • fixedRate

      String fixedRate
      Returns:
      The fixed rate in milliseconds to create the PeriodicTrigger with fixedRate. Can be specified as 'property placeholder', e.g. ${poller.fixedRate}.
      Default:
      ""
    • cron

      String cron
      Returns:
      The cron expression to create the CronTrigger. Can be specified as 'property placeholder', e.g. ${poller.cron}.
      Default:
      ""
    • errorChannel

      String errorChannel
      Returns:
      The the bean name of default error channel for the underlying MessagePublishingErrorHandler.
      Since:
      4.3.3
      Default:
      ""
    • receiveTimeout

      String receiveTimeout
      Only 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:
      ""