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

Robbie Gemmell commented on PROTON-1098:
----------------------------------------

Commented on the PR but forgot to mention the JIRA key, posting here for later 
reference.

Comment is at: 
https://github.com/apache/qpid-proton/pull/54#issuecomment-171666793 and quoted 
below.
{quote}
Hi Sreeram

Expanding the Message\[Impl\] to support multiple body sections is something 
that would be good to see done, but isn't something I've had time for 
previously and I'm working on other things at the moment. Whilst this change 
certainly works, I'm not sure the approach would fit in particularly well with 
making those more general improvements.

It is worth noting that the Message\[Impl\] in proton-j is basically just a 
helper in the end that you don't actually have to use, the actual message bytes 
sent via the Delivery object can be generated in other ways.

In the mean time, with what is available now there are some ways I think you 
could probably send multiple Data sections currently, for example:

    Use an Message object with any 
headers/delivery-annotations/message-annotations/properties/application-properties
 (and perhaps even the first data section set as the body), encode that.
    Encode subsequent data body sections and append to the previous bytes.

For the second bit above there would be various options, such as:

    Use a Message object with only a data body set, encode that and append to 
previous bytes, repeating as needed for the n'th data section.
    Use the very confusingly named org.apache.qpid.proton.codec.Data (which has 
nothing specifically to do with data sections) to write out all the data 
sections as DescribedType's. We do something similar in a test peer for the JMS 
client codebase, e.g at \[1\] it prepares an entire message this way with the 
body content possibly being a DataDescribedType \[2\].
    Write a simple encoder to generate the data section bytes by writing out 
the necessary descriptor + Binary format/length bytes followed by the content 
bytes.

\[1\] 
https://github.com/apache/qpid-jms/blob/2f3c1988606c215cca0bbb77d3462cdc15c36016/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java#L1443
\[2\] 
https://github.com/apache/qpid-jms/blob/2f3c1988606c215cca0bbb77d3462cdc15c36016/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/describedtypes/sections/DataDescribedType.java
Note that \[2\] is using the symbolic descriptor, but for non-test code the 
numeric descriptor would probably be preferred.
{quote}

> Add support for one or More Data Sections in AmqpMessage
> --------------------------------------------------------
>
>                 Key: PROTON-1098
>                 URL: https://issues.apache.org/jira/browse/PROTON-1098
>             Project: Qpid Proton
>          Issue Type: New Feature
>          Components: proton-j
>    Affects Versions: 0.12.0
>            Reporter: Sreeram Garlapati
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> As per Amqp 1.0 spec: 
> http://docs.oasis-open.org/amqp/core/v1.0/amqp-core-complete-v1.0.pdf, 
> AmqpMessage MessageFormat:0 should allow having one or more data sections. 
> Reference from the Spec:
> "Thebodyconsistsofoneofthefollowingthreechoices: 
> oneormoredatasections,oneormoreamqp-sequence sections, or a single amqp-value 
> section".
> This is a feature request from Windows Azure EventHubs team. This is heavily 
> used for enabling critical scenarios. I deeply Appreciate your help here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to