Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-1778

Queue filter based on AMQSize always returns false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • AMQ 7.1.0.GA, AMQ 7.2.0.GA
    • broker-core
    • None

      The documentation [1] references several predefined Identifiers for use witha queue filter, one of these is AMQSize. The code mentions the following for the identifier:

      ./docs/user-manual/en/filter-expressions.md

      `AMQSize`. The size of a message in bytes. The value is an integer.

      A queue filter is being created as follows:

               <address name="myQueue">
      		           <anycast>
      		              <queue name="myQueue">
      		                <filter string="AMQSize &lt; 10485760"/>
      		              </queue>
      		           </anycast>
              </address>
      

      The desired behavior is to filter out any message > 10MB.

      However this filter always returns false no matter the size of the message. Browsing a messages on the queue I'm doesn't reveal where the AMQSize gets set:

      1MB message:

      {"address":"myQueue","ShortProperties":{},"messageID":"5978","priority":4,"type":3,"userID":"ID:a3cb522c-85f6-11e8-a2a8-3c15c2cefab8","redelivered":false,"ByteProperties":{"_AMQ_ROUTING_TYPE":1},"LongProperties":{},"IntProperties":{},"durable":true,"StringProperties":{"__AMQ_CID":"a3c314c9-85f6-11e8-a2a8-3c15c2cefab8"},"DoubleProperties":{},"expiration":0,"text":"Message sent at: Thu Jul 12 13:11:39 EDT 2018","PropertiesText":"{__AMQ_CID=a3c314c9-85f6-11e8-a2a8-3c15c2cefab8, _AMQ_ROUTING_TYPE=1}","BooleanProperties":{},"FloatProperties":{},"timestamp":1531415499125}],"timestamp":1531416399,"status":200}
      

      10MB message:

      {"address":"myQueue","ShortProperties":{},"messageID":"5972","priority":4,"type":3,"userID":"ID:669e011b-85f6-11e8-a33c-3c15c2cefab8","redelivered":false,"ByteProperties":{"_AMQ_ROUTING_TYPE":1},"LongProperties":{"_AMQ_LARGE_SIZE":20971525},"IntProperties":{},"durable":true,"StringProperties":{"__AMQ_CID":"66839b48-85f6-11e8-a33c-3c15c2cefab8"},"DoubleProperties":{},"expiration":0,"text":"","PropertiesText":"{__AMQ_CID=66839b48-85f6-11e8-a33c-3c15c2cefab8, _AMQ_ROUTING_TYPE=1, _AMQ_LARGE_SIZE=20971525}","BooleanProperties":{},"FloatProperties":{},"timestamp":1531415396487}
      

      From the message properties above, a large message gets a long property named _AMQ_LARGE_SIZE added. This property can be used in the filter, however is only available for large messages. The documented AMQSize doesn't seem to work for any message.

      [1] https://access.redhat.com/documentation/en-us/red_hat_amq/7.1/html-single/using_amq_broker/index#filters

              rhn-support-jbertram Justin Bertram
              rhn-support-jsherman Jason Sherman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: