[
https://issues.apache.org/jira/browse/PROTON-1505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051038#comment-16051038
]
Kim van der Riet edited comment on PROTON-1505 at 6/15/17 8:52 PM:
-------------------------------------------------------------------
I have adjusted the components and title of this issue to better reflect what
has been discovered:
Further investigation shows that the default message priority only works if
there is *no header* on the message. If any header is present (but not
containing message priority), then the message priority is returned as 0 rather
than the default of 4.
As this happens on both the C++ and Python bindings, this looks like a Proton
bug.
Inspection of the code shows that if any header is present (message.c:677), it
is scanned for the various header components through a call to
{{pn_data_scan()}} and then {{pn_data_vscan()}}. This function scans for each
type in the format code list (message priority is type 'B' - {{PN_UBYTE}}), and
if the scan is unsuccessful, the the value is set to 0 (codec.c:758). This
overwrites the value of {{PN_DEFAULT_PRIORITY}} set when the message was
originally created.
was (Author: kpvdr):
I have adjusted the components and title of this issue to better reflect what
has been discovered:
Further investigation shows that the default message priority only works if
there is *no header* on the message. If any header is present (but not
containing message priority), then the message priority is returned as 0 rather
than the default of 4.
As this happens on both the C++ and Python bindings, this looks like a Proton
bug.
Inspection of the code shows that if any header is present (message.c:677), it
is scanned for the various header components through a call to
{{pn_data_scan()}}. This function scans for each type in the format code list
(message priority is type 'B' - {{PN_UBYTE}}), and if the scan is unsuccessful,
the the value is set to 0 (codec.c:758). This overwrites the value of
{{PN_DEFAULT_PRIORITY}} set when the message was originally created.
> Message header defaults only work if no header present
> ------------------------------------------------------
>
> Key: PROTON-1505
> URL: https://issues.apache.org/jira/browse/PROTON-1505
> Project: Qpid Proton
> Issue Type: Bug
> Components: proton-c
> Reporter: Kim van der Riet
> Assignee: Cliff Jansen
>
> An error in the qpid-interop-tests JMS headers test showed that where there
> is no message header on the wire, the C++ and Python client APIs do not
> return the default value as mandated by the AMQP spec. In particular, the
> priority is returned with a value of 0 rather than the default value of 4.
> This raises two issues:
> 1. Setting the default value (in particularly for priority, where a priority
> system may be adopted that is not default, and the missing value may need to
> have a value other than 4).
> 2. (C++) Gaining access to the transport headers so that there is an ability
> to distinguish between the default and the value being actually present on
> the wire.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]