Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-14212

Support non-blocking receiveTimeout in AbstractPollingMessageListenerContainer

    Details

      Description

      AbstractPollingMessageListenerContainer#receiveMessage currently blocks indefinitely both on negative values and 0 as receiveTimeout. The documentation for receiveTimeout mentions -1, but not 0. However, MessageConsumer#receive blocks if the timeout is 0 and AbstractPollingMessageListenerContainer uses receive() or receive(timeout) - never receiveNoWait().

      In some cases, for example with Oracle AQ, receiveNoWait yields better performance.

      It is very simple to fix this. Simply check for 0 and call receiveNoWait. I will create a pull request.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                erik-wramner Erik Wramner
                Last updater:
                Spring Issuemaster
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 1 week, 6 days ago