[
https://issues.apache.org/jira/browse/QPID-6052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14116802#comment-14116802
]
Robbie Gemmell commented on QPID-6052:
--------------------------------------
In AMQMessageDelegate_0_8, this code will fail to pass the 'subject' of the
Address unless the 'strict jms' flag is set. Its not clear this is intended, as
it seems the code is simply aiming to rewriting the 'qpid.subject' property to
use a legal JMS property name whenever 'strict jms' is set. That looks like a
defect introduced when the renaming functionality (which has been copies here)
was added in QPID-3838 (via http://svn.apache.org/r1480656 and some further
tidyup commits), which would mean some addresses being returned by
convertToAddressBasedDestination(..) will have been different (and presumably
wrong) ever since that point unless 'strict jms' happened to be set.
{noformat}
+ String subject = null;
+ if (contentHeader.getHeaders() != null
+ &&
contentHeader.getHeaders().containsKey(QpidMessageProperties.QPID_SUBJECT)
+ && STRICT_JMS)
+ {
+ subject =
contentHeader.getHeaders().getString(QpidMessageProperties.QPID_SUBJECT);
+ if (subject != null)
+ {
+
contentHeader.getHeaders().remove(QpidMessageProperties.QPID_SUBJECT);
+ contentHeader.getHeaders().setString("JMS_" +
QpidMessageProperties.QPID_SUBJECT_JMS_PROPER,
+ subject);
+ }
+ }
+ if(type == null)
+ {
+ type = addressType;
+ }
+ dest = (AMQDestination)
convertToAddressBasedDestination(AMQShortString.toString(exchange),
+
AMQShortString.toString(routingKey), subject,
+ true,
type);
{noformat}
In relation to the qpid.subject renaming in the above code, there is no
matching 'compatibility remapping' for accessing the property as is done in
AMQMessageDelegate_0_10.getStringProperty(String), might be worth adding for
consistency. Even though no existing 0-9-1 users would be expected to be using
that property and thus be affected by it being remapped, someone moving from
using 0-10 back to 0-9-1 might be...
{noformat}
else if (isStrictJMS &&
QpidMessageProperties.QPID_SUBJECT.equals(propertyName))
{
return (String)getApplicationHeaders().get("JMS_" +
QpidMessageProperties.QPID_SUBJECT_JMS_PROPER);
}
{noformat}
The second comment is arguable...someone asking for qpid.subject to be remapped
should probably be happy needing to use the remapped name. I only pointed it
out as the first comment originally asked 'since the 0-9-1 client never really
used the illegal property, should it possibly always remap the name to be
legal?' but then I removed that :)
> [Java Client] The client does not correctly set the JMSDestination on a 0-9-1
> message in ADDR mode
> --------------------------------------------------------------------------------------------------
>
> Key: QPID-6052
> URL: https://issues.apache.org/jira/browse/QPID-6052
> Project: Qpid
> Issue Type: Bug
> Components: Java Client
> Reporter: Rob Godfrey
> Assignee: Rob Godfrey
>
> Even when using ADDR address in 0-9-1, received messages are created with a
> JMSDestination in the form of a BindingURL address. Where ADDR is the
> default syntax, an ADDR address should be created.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]