Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2848

BasicMessageConsumer_0_10 contains dead and questionable code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • M3, M4, 0.5, 0.6
    • None
    • JMS AMQP 0-x
    • None

    Description

      In BasicMessageConsumer_0_10, there is a field named _preAcquire. Its value is set true by default and toggled false at construction time if the given destination is an instance of AMQQueue.

      During the notifyMessage() method, when client side selector evaluation of the incoming message is performed in the checkPreConditions() method, if the filter indicates the message is not a match then the _preAcquire field is used to determine acknowledgment and/or release actions to take that would seem to indicate the _preAcquire field is meant to describe the session acquire mode. Judging this value based on the incoming destination does not seem correct as this is actually a property of the Session used.

      Subsequent to the above mentioned uses the _preAcquire field is also used to determine whether to accept the message.

      Further to the above, the code called to perform acknowledgement and releases is dead and can never actually execute because it too depends on the _preAcquire field but inverted from the previous use:

      if (_preAcquire)
      {
      ...
      acknowledgeMessage(message);
      }
      else
      {
      ...
      releaseMessage(message);
      }

      followed by:

      private void acknowledgeMessage(AbstractJMSMessage message) throws AMQException
      {
      if (!_preAcquire)

      { ... }
      }

      and:

      private void releaseMessage(AbstractJMSMessage message) throws AMQException
      {
      if (_preAcquire)
      { ... }

      }

      Attachments

        Activity

          People

            kwall Keith Wall
            robbie Robbie Gemmell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: