Alan Conway created PROTON-1987:
-----------------------------------

             Summary: [cpp] Encode/decode all legal message body types.
                 Key: PROTON-1987
                 URL: https://issues.apache.org/jira/browse/PROTON-1987
             Project: Qpid Proton
          Issue Type: Improvement
          Components: cpp-binding
    Affects Versions: proton-c-0.26.0
            Reporter: Alan Conway


>From AMQP spec 
>[http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-message-format]

_The body consists of one of the following three choices:_
 # _one or more 
[data|http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-data]
 sections,_
 # _one or more 
[amqp-sequence|http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-amqp-sequence]
 sections,_
 # _or a single 
[amqp-value|http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-amqp-value]
 section._

It actually *is* currently possible to encode and decode all these body formats 
using a combination of AMQP value types and the message::inferred() flag. 
However, they way it works is not intuitive, and it is easy to encode an 
illegal body format (e.g. mix section types) which won't be detected till 
runtime.

A better API should:
 * Make it easy to set/determine the body encoding style.
 * Type safe API that can only encode legal body formats.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to