You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Steigerwald, Aaron" <as...@brandesassociates.com.INVALID> on 2023/12/06 19:55:17 UTC

STOMP client receives undefined priority header when JMSPriority = 4 (default)

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

Re: [EXTERNAL]:Re: STOMP client receives undefined priority header when JMSPriority = 4 (default)

Posted by "Steigerwald, Aaron" <as...@brandesassociates.com.INVALID>.
Hello Timothy,

Thank you very much for this explanation. It’s exactly what I needed. I replied to Justin’s email before I read it.

Thanks again and have a good weekend,
Aaron

________________________________
From: Timothy Bish <ta...@gmail.com>
Sent: Friday, December 8, 2023 3:42 PM
To: users@activemq.apache.org <us...@activemq.apache.org>
Subject: Re: [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.]
________________________________


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 <jb...@apache.org>
> Sent: Thursday, December 7, 2023 11:36 PM
> To: users@activemq.apache.org <us...@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
> <as...@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


Re: [EXTERNAL]:Re: STOMP client receives undefined priority header when JMSPriority = 4 (default)

Posted by Timothy Bish <ta...@gmail.com>.
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 <jb...@apache.org>
> Sent: Thursday, December 7, 2023 11:36 PM
> To: users@activemq.apache.org <us...@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
> <as...@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


Re: [EXTERNAL]:Re: STOMP client receives undefined priority header when JMSPriority = 4 (default)

Posted by Justin Bertram <jb...@apache.org>.
Given the information provided by Tim on this thread I don't believe this
is a bug but rather the result of a specific design decision.


Justin

On Fri, Dec 8, 2023 at 3:09 PM Steigerwald, Aaron
<as...@brandesassociates.com.invalid> wrote:

> Hello Justin,
>
> Thank you for checking! Purposely not setting the AMQP priority header if
> the value is the JMS default value seems odd to me. I’ll let sleeping dogs
> lie if you don’t think it’s a bug.
>
> Thanks again,
> Aaron
>
> ________________________________
> From: Justin Bertram <jb...@apache.org>
> Sent: Friday, December 8, 2023 3:42 PM
> To: users@activemq.apache.org <us...@activemq.apache.org>
> Subject: Re: [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.]
> ________________________________
>
>
> Looking at the code [1] that converts the message from core to AMQP I can
> see that it will not set the priority if it's the default value (i.e. 4) so
> I would say what you're seeing is expected.
>
>
> Justin
>
> [1]
>
> https://github.com/apache/activemq-artemis/blob/main/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/CoreAmqpConverter.java#L115
>
> On Fri, Dec 8, 2023 at 2:25 PM Steigerwald, Aaron
> <as...@brandesassociates.com.invalid> 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 <jb...@apache.org>
> > Sent: Thursday, December 7, 2023 11:36 PM
> > To: users@activemq.apache.org <us...@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
> > <as...@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
> > >
> >
>

Re: [EXTERNAL]:Re: STOMP client receives undefined priority header when JMSPriority = 4 (default)

Posted by "Steigerwald, Aaron" <as...@brandesassociates.com.INVALID>.
Hello Justin,

Thank you for checking! Purposely not setting the AMQP priority header if the value is the JMS default value seems odd to me. I’ll let sleeping dogs lie if you don’t think it’s a bug.

Thanks again,
Aaron

________________________________
From: Justin Bertram <jb...@apache.org>
Sent: Friday, December 8, 2023 3:42 PM
To: users@activemq.apache.org <us...@activemq.apache.org>
Subject: Re: [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.]
________________________________


Looking at the code [1] that converts the message from core to AMQP I can
see that it will not set the priority if it's the default value (i.e. 4) so
I would say what you're seeing is expected.


Justin

[1]
https://github.com/apache/activemq-artemis/blob/main/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/CoreAmqpConverter.java#L115

On Fri, Dec 8, 2023 at 2:25 PM Steigerwald, Aaron
<as...@brandesassociates.com.invalid> 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 <jb...@apache.org>
> Sent: Thursday, December 7, 2023 11:36 PM
> To: users@activemq.apache.org <us...@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
> <as...@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
> >
>

Re: [EXTERNAL]:Re: STOMP client receives undefined priority header when JMSPriority = 4 (default)

Posted by Justin Bertram <jb...@apache.org>.
Looking at the code [1] that converts the message from core to AMQP I can
see that it will not set the priority if it's the default value (i.e. 4) so
I would say what you're seeing is expected.


Justin

[1]
https://github.com/apache/activemq-artemis/blob/main/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/CoreAmqpConverter.java#L115

On Fri, Dec 8, 2023 at 2:25 PM Steigerwald, Aaron
<as...@brandesassociates.com.invalid> 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 <jb...@apache.org>
> Sent: Thursday, December 7, 2023 11:36 PM
> To: users@activemq.apache.org <us...@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
> <as...@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
> >
>

Re: [EXTERNAL]:Re: STOMP client receives undefined priority header when JMSPriority = 4 (default)

Posted by "Steigerwald, Aaron" <as...@brandesassociates.com.INVALID>.
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 <jb...@apache.org>
Sent: Thursday, December 7, 2023 11:36 PM
To: users@activemq.apache.org <us...@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
<as...@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
>

Re: STOMP client receives undefined priority header when JMSPriority = 4 (default)

Posted by Justin Bertram <jb...@apache.org>.
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
<as...@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
>