If you are sending a stream of data and you don't know how big it is, then you cannot use an amqp-value until you have all the data buffered as every AMQP datatype is encoded either with a fixed size or with the size as a prefix. If there is more than 4Gb of data you cannot sent it at all.
As Gordon pointed out, the key difference is in section 3.2: - 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. You can only have a single amqp-value section, but one or more amqp-sequence or data With Data sections you can send multiple sections, with the section boundaries themselves not having any semantic meaning. Similarly if you are sending a sequence of objects, to use a list encoding you need to know the count and size before sending can commence, with a amqp-sequence you can send a number of sequence sections as the objects become available. A different design choice might have been to enable multiple amqp-value sections, but the implied semantic is different: a series of binary strings string1, string2, string3 each in separate amp-values would not be the same as a single binary string string1string2string3. -- Rob On 2 August 2013 13:37, Rakesh Kushwaha <kushwah...@gmail.com> wrote: > Hi Rob, > > streaming or large message transfer is enabled by just enabling <more= > true> in transfer frame . > > for Amqp sequence , amqp specification says* "A sequence section > contains an arbitrary number of structured data elements". * > as parent type of amqp sequence is LIST which is a compound data type > will have size encoded for this data type . > streaming can be implemented transfer frame 's <more=true> if we can't > send whole list elements in one go as I understand. > > For DATA type also above holds true as per my understanding . > > I can't related your answer through amqp specification here , > > Now for amqp value specfication says "An* amqp-value section contains a > single AMQP value." * > if size of this amqp value is more than then also streaming may be > required . what i don't understand is what this "* single AMQP value" > means. (Number 1 confusion)* > > *as amqp value parent type *(any type) ,ideally this can include any > thing "primitives types , described typed , compound types". if * is > replaced by list then it can have multiple elements .* > > *and if * can replaced by Binary then it can have DATA also.* > * > * > > * > * > <type name="data" class="restricted" source="binary" provides="section">* > * > <type name="amqp-sequence" class="restricted" source="list" > provides="section"> > <type name="amqp-value" class="restricted" source="*" provides="section"> > // here * can be both list, binary. > > ** means any type why we need DATA and SEQUENCE (number 2 confusion).* > *:)* > *Regards,* > *Rakesh* > > > > * > * > *Regards,* > *Rakesh* > * > * > * > * > * > * > > > > > > > > > > > > > > > > > On Fri, Aug 2, 2013 at 1:40 PM, Rob Godfrey <rob.j.godf...@gmail.com>wrote: > >> On 2 August 2013 09:35, Rakesh Kushwaha <kushwah...@gmail.com> wrote: >> >> > My Question was on format , if for amqp value we have <source=*> that >> means >> > it can have both BINARY and LIST kind data type . >> > >> > then why we needed DATA and AMQP SEQUENCE . >> > >> > >> As I answered before: data and sequence allow for the case where the size >> of the data is not known up front by the sending application. AmqpValue >> requires that you know the size before sending. >> >> -- Rob >> >> >> > Regards, >> > Rakesh >> > >> > >> > On Thu, Aug 1, 2013 at 6:54 PM, Rob Godfrey <rob.j.godf...@gmail.com> >> > wrote: >> > >> > > Yes indeed Gordon, thank you for clarifying >> > > >> > > -- Rob >> > > >> > > >> > > On 1 August 2013 15:01, Gordon Sim <g...@redhat.com> wrote: >> > > >> > > > On 08/01/2013 01:52 PM, Rob Godfrey wrote: >> > > > >> > > >> Data and AmqpSequence allow the sender to start sending data >> without >> > > >> knowing how many bytes / values the data is going to consist of. >> This >> > > >> allows for streaming scenarios where the size of the data is not >> known >> > > up >> > > >> front. >> > > >> >> > > >> Note also that there is no bound to the size of Data or >> AmqpSequence, >> > > >> whereas an AmqpValue will always be bounded by the largest AMQP >> data >> > > type >> > > >> - >> > > >> i.e. 4Gb (not that I would ever recommend sending a single message >> of >> > > >> greater than 4Gb). >> > > >> >> > > > >> > > > Just to clarify, each individual section of type Data or >> AmqpSequence >> > is >> > > > bounded and has its size encoded upfront. The ability to stream >> and/or >> > > send >> > > > unbounded amounts of data comes through sending multiple such >> sections >> > in >> > > > the same message. Right? (Whereas only a single AmqpValue section is >> > > > allowed per message). >> > > > >> > > > >> > > > >> > >> ------------------------------**------------------------------**--------- >> > > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.**org< >> > > users-unsubscr...@qpid.apache.org> >> > > > For additional commands, e-mail: users-h...@qpid.apache.org >> > > > >> > > > >> > > >> > >> > >