Bug 988297

Summary: qpid::messaging::Message API doesn't permit sending non-string message IDs
Product: Red Hat Enterprise MRG Reporter: Frantisek Reznicek <freznice>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: NEW --- QA Contact: Messaging QE <messaging-qe-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: DevelopmentCC: gsim, jross, pematous
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: 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:

Description Frantisek Reznicek 2013-07-25 09:20:17 UTC
Description of problem:

qpid::messaging::Message API does not fully model AMQP 1.0 Message enhancements.


qpid::messaging resp. qpid.messaging API was built with AMQP 0-10 in mind.
AMQP 1.0 come with some changes in Message model:
message-id may be in various types:
  <field name="message-id" type="*" requires="message-id"/>

  <type name="message-id-ulong" class="restricted" source="ulong" provides="message-id"/>
  <type name="message-id-uuid" class="restricted" source="uuid" provides="message-id"/>
  <type name="message-id-binary" class="restricted" source="binary" provides="message-id"/>
  <type name="message-id-string" class="restricted" source="string" provides="message-id"/>

See [1] chapters 3.2.4, 3.2.11 - 3.2.14.

Moreover there were added following message properties:
  <field name="to" type="*" requires="address"/>
  <field name="subject" type="string"/>
  <field name="group-id" type="string"/>
  <field name="group-sequence" type="sequence-no"/>
  <field name="reply-to-group-id" type="string"/>

 ( <field name="absolute-expiry-time" type="timestamp"/> matches probably to expriration in amqp 0-10)

I was comparing [1] 3.2.4 Properties vs. [2] 'Domain: message.message-properties'


The qpid proton APIs are at the moment reflecting [1] 3.2.4 table well except field 'to' which is there not available as well.

Is there plan to extend qpid::messaging / qpid.messaging to support also AMQP 1.0 specific fields? If not it is necessary to guide users using documentation to use qpid proton API.
Feel free to reassign to docs based on your judgement.


[1] http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html
[2] amqp.0-10.pdf
[3] http://qpid.apache.org/releases/qpid-0.22/messaging-api/cpp/api/classqpid_1_1messaging_1_1Message.html
[4] pylint qpid.messaging.Message


Version-Release number of selected component (if applicable):
qpid-0.22

How reproducible:
100%

Steps to Reproduce:
1. check [3] getMessageId() method > std::string & 	getMessageId () const 
2. AMQP 1.0 says ([1] chapters 3.2.4) it may be string

Actual results:
qpid::messaging does not fully support AMQP 1.0 message

Expected results:
qpid::messaging to fully support AMQP 1.0 message or document there are some gaps.

Additional info:

Comment 1 Justin Ross 2013-08-05 15:32:55 UTC
Gordon, please assess.

Comment 2 Gordon Sim 2013-08-05 15:55:45 UTC
Regarding the possibility of different message-id types, the code at present should map all 1.0 allowed types onto a string for incoming messages. If the id is a UUID this will be the stringified representation of the UUID; if the id is a long, this will be a string representing that number (e.g. "1000346"), if it is a binary or a string then it will hold the actual bytes as sent. However at present there is no way to send an id as anything other than a string. That should really be fixed.

Regarding the added message properties, the AMQP 1.0 specific fields can be accessed as pseudo-properties using the key format x-amqp-<field-name>, where <field-name> is the name of the field in the AMQP 1.0 specification.  The keys currently in use are: x-amqp-first-acquirer and x-amqp-delivery-count for the header section, and x-amqp-to, x-amqp-absolute-expiry-time, x-amqp-creation-time, x-amqp-group-id, x-amqp-qroup-sequence and
x-amqp-reply-to-group-id for the properties section. Of course explicit accessors could also be added for these, but that would be more for convenience rather than absolute necessity.

Comment 3 Justin Ross 2013-09-26 17:15:34 UTC
"However at present there is no way to send an id as anything other than a string. That should really be fixed."

I'm taking this to be the content of this issue as of now.

Comment 4 Gordon Sim 2013-09-26 17:19:57 UTC
Yes, that is the issue. My view is it isn't super urgent (correct me if that is wrong). Its very much a case of anticipating corner cases. I've added https://issues.apache.org/jira/browse/QPID-5180 upstream to track the issue.