Bug 1264000

Summary: Docs: MPR should describe all JMS headers mappings to AMQP 1.0 for selectors
Product: Red Hat Enterprise MRG Reporter: Michal Toth <mtoth>
Component: Messaging_Programming_ReferenceAssignee: Scott Mumford <smumford>
Status: CLOSED CURRENTRELEASE QA Contact: Michal Toth <mtoth>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 3.2CC: gsim, mtoth, smumford, zkraus
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-13 13:01:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1215806    

Description Michal Toth 2015-09-17 09:43:32 UTC
Description of problem:
Currently MPR document contains only 3 JMS header names (mapped to AMQP 1.0) in "Table 20.15. Mapping JMS Headers to AMQP fields".
Similar mapping to AMQP-0.10 can be found in "Table 20.3. Java JMS Mapping to AMQP 0-10 Message Properties". (this one is complete)

So I think, we should also fully document mapping between JMS <-> AMQP 1.0 in table 20.15 or just add note,
that this mapping works in both AMQP 0.10 and 1.0 versions.

Personally, I have found to be the most tricky to use "JMSDeliveryMode" how to use NON_PERSISTENT and PERSISTENT options were not clear on first thought.

Actual results:
Mapping between JMS and AMQP 1.0 is unfinished.
Currently only "delivery_mode", "priority" and "redelivered" are documented.

Expected results:
All JMS header names are documented in the table.
JMSType
JMSCorrelationID
JMSMessageID
JMSDeliveryMode
JMSRedelivered
JMSPriority
JMSDestination
JMSReplyTo
JMSTimestamp
JMSExpiration

Additional info:
See Bug 1254944 for more information.

Comment 1 Scott Mumford 2015-09-22 00:52:12 UTC
Hi Michal,

I notice that two of the header names you've listed don't appear in either table: JMSDestination and JMSTimestamp.

Can you point me to where I'd get the AMQP headers that map to those?

Once I've got that info I'll add it to the contents of the second table (20.3), then copy that table into the first location (table 20.15) and replace table 20.3 with a link back to the first (it makes no sense to duplicate the content like this).

I'll also add a note that these mappings are consistent with both AMQP 0.10 and 1.0.

If I've misunderstood anything, please let me know.

Comment 2 Michal Toth 2015-09-22 06:30:33 UTC
Hi, 

 I have added affecting BZ to "See also" field here which points to original Bug 1254944. For documentation, you should ask developers for development notes on what has been changed, how to document it etc, which points to Gordon (setting need info on him here). :)

As from what was changed, if I look at his patch to broker (which I should not as QA :) ), I see, that here "https://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Selector.cpp?r1=1698426&r2=1698425&pathrev=1698426" is done "probably all" the mapping. 

Please wait for Gordon's approval about this. ;)

On the updates of doc tables, looks like it will work well.
I hope it answers your questions.
 Thank you Scott.

Comment 3 Gordon Sim 2015-09-22 08:29:54 UTC
The translation performed by qpidd is as follows:

JMSType          -> subject field in properties
JMSCorrelationID -> correlation-id field in properties
JMSMessageID     -> message-id field in properties
JMSDeliveryMode  -> durable ? "PERSISTENT" : "NON_PERSISTENT"  (computed from field in header)
JMSRedelivered   -> delivery-count > 0 (computed from field in header)
JMSPriority      -> priority field in header
JMSDestination   -> to field in properties
JMSReplyTo       -> reply-to field in properties
JMSTimestamp     -> creation-time field in properties
JMSExpiration    -> absolute-expiry-time field in properties

However from the JMS spec: "Message header field references are restricted to JMSDeliveryMode, JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and
JMSType." So when using JMS, only these fields would strictly be valid in a selector. (The broker doesn't enforce this. the client might).

Comment 5 Michal Toth 2015-09-25 08:09:24 UTC
Changes made in MPR looks good to me.
I am marking it as verified.
Thank you