The AMQP specification defines that the priority value carried in the AMQP Header section of the Message has a default value of 4 which means that an AMQP peer may omit this value on the wire to reduce encoding size if it chooses to and the receiving peer should interpret that as carrying the default (4).  Equally the sending peer could omit the AMQP Header entirely if all defaults were used in which case the receiving peer again must infer the defaults.

It is likely the case that the Rhea client simply returns null when the priority value is omitted (or the full Header) and leaves it to you to infer that the value is the default as it should be treated that way.  Some clients will return a value of 4 just for ease of use but regardless you should assume that an empty priority value in the Header implies the default (4).

http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-header

On 12/8/23 15:25, Steigerwald, Aaron wrote:
Hello Justin,

I’m sorry to report that I mistook an old AMQP test client for STOMP. The 
problem I reported actually occurs with the RHEA AMQP node.js client code. 
Everything else I reported is accurate.

Any idea if the priority should be undefined using an AMQP client when the 
message’s JMSPriority is 4?

Thanks again,
Aaron

________________________________
From: Justin Bertram <jbert...@apache.org>
Sent: Thursday, December 7, 2023 11:36 PM
To: users@activemq.apache.org <users@activemq.apache.org>
Subject: [EXTERNAL]:Re: STOMP client receives undefined priority header when 
JMSPriority = 4 (default)

[CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.]
________________________________


I just tested this on the main branch with an OpenWire JMS producer and the
STOMP client in our test-suite. The OpenWire JMS producer did not invoke
setJMSPriority and the STOMP client received a message with a header
"priority" with the value "4".

What version of ActiveMQ Artemis are you using? Can you provide steps to
reproduce what you're seeing or possibly a STOMP protocol trace log [1]
from when you observe this behavior?


Justin

[1]
https://activemq.apache.org/components/artemis/documentation/latest/stomp.html#logging

On Wed, Dec 6, 2023 at 1:55 PM Steigerwald, Aaron
<asteigerw...@brandesassociates.com.invalid> wrote:

Hello,

My STOMP client receives populated priority header values when it consumes
OpenWire JMS messages with valid JMSPriority values except 4. Is this
expected behavior because 4 is the default JMSPriority value? Should the
STOMP client assume the priority is 4 if the priority header is undefined?

This occurs with an Artemis broker, an OpenWire producer, and a stompit
consumer.

Thank you,
Aaron


--
Tim Bish

Reply via email to