[ 
https://issues.apache.org/jira/browse/QPIDJMS-479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16968341#comment-16968341
 ] 

Robbie Gemmell commented on QPIDJMS-479:
----------------------------------------

The client does always set the 'to' field on outgoing messages, as it is both 
expected and allowed to. Setting the 'to' field in this manner is specification 
compliant.

The snippet you list from 3.3.2 of the draft AMQP JMS mapping document (which I 
wrote) is specifically around what happens when the client receives a message, 
not sends ones, with the final sentence being around behaviour for a message 
that has no 'to' field value. This is since 'to' is optional in AMQP but JMS 
effectively requires there always be a JMSDestination value to return since it 
must be stamped on send. Earlier in the mapping document, section 3.2.1, the 
behaviour around sending is outlined where the JMSDestination address must be 
carried in the 'to' field on send.

The snippet from section 3.2.4 of the AMQP spec allows for the 'to' field to 
differ from the link target, it does not require it, and certainly doesn't 
forbid setting the value to the same address as the link target. Per the JMS 
Mapping doc, the 'to' field is used to carry the JMSDestination address the 
message is being sent to, which must be stamped upon send as required by JMS. 
If a producing link is established to a specific address (i.e a JMS producer is 
created to a fixed JMSDestination) then the 'to' field of messages it sends 
will match the link target address. If an anonymous sending link is being used 
by the client (i.e the peer supports anonymous relay, and either a JMS 
MessageProducer without a fixed JMSDestination, or a JMSProducer, is being 
used), then the 'to' address will differ from the link address (which would be 
null).

 

> [JMS Client] JMS client breaks AMQP 1.0 specification by always setting the 
> "to" property equal to link address.
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: QPIDJMS-479
>                 URL: https://issues.apache.org/jira/browse/QPIDJMS-479
>             Project: Qpid JMS
>          Issue Type: Bug
>          Components: qpid-jms-client
>    Affects Versions: 0.46.0, 0.47.0
>            Reporter: Yufei Cai
>            Priority: Major
>
> [https://github.com/apache/qpid-jms/blob/0.47.0/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java#L859-L890]
>  
> The class JmsSession of Qpid JMS client always calls 
> "Message.setJMSDestination" with the link address before sending the message. 
> This is not specification-conform.
>  
> From AMQP JMS mapping v1.0 section 3.3.2 (Note the final setence: The 
> JMSDestination should be derived from the link address ONLY IF it is not set):
> {quote}to
> This field is mapped to the JMSDestination header of the Message. 
> JMSDestination is defined as being of the JMS Destination type, while the to 
> field of properties requires an address-string. See 5. Destinations for 
> REQUIRED detail regarding how conversion between these types is achieved if 
> the to field of properties was set. If the to field of properties was not set 
> on a received message, the JMSDestination header value SHOULD be derived from 
> the Destination to which the receiving consumer was established.
> {quote}
>  
> From AMQP 1.0 specification section 3.2.4:
> {quote}to         the address of the node the message is destined for
> The to field identifies the node that is the intended destination of the 
> message. On any given transfer this might not be the node at the receiving 
> end of the link.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to