qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PROTON-1940) [c] normalize encoding of multiple="true" fields
Date Wed, 26 Sep 2018 16:08:00 GMT

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

ASF GitHub Bot commented on PROTON-1940:
----------------------------------------

Github user alanconway commented on the issue:

    https://github.com/apache/qpid-proton/pull/159
  
    Changes prompted by astitcher's comments:
    
    - better explanation of mulitple fields, corrected AMQP spec links
    - added block comment for vfill format letters
    - factored out pni_normalize_multiple to reduce visual churn in _vfill() impl
    
    Not changed: still using a new format letter. 2 reasons - consistency and efficiency/ease
of impl:
    
    consistency: the multiple attribute is part of an AMQP composite field definition. The
purpose of _vfill() is to fill in composite fields correctly - so IMO that is where this belongs.
I personally hate the vfill char-based mini-language; it is hard to read, hard to remember
and error-prone. However it seems like something we should replace entirely or live with for
now, rather than have inconsistent approaches for different fields.
    
    ease of impl: as part of vfill, we can copy exactly as much of the source data as we need
to the target. A normalize function outside of vfill would either have to modify the source
value in-place (side-effects on caller's data value) or create an intermediate copy (expensive,
extra memory management) Both are inconsistent with existing use of vfill.
    



> [c] normalize encoding of multiple="true" fields
> ------------------------------------------------
>
>                 Key: PROTON-1940
>                 URL: https://issues.apache.org/jira/browse/PROTON-1940
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: proton-c
>    Affects Versions: proton-c-0.25.0
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>            Priority: Major
>             Fix For: proton-c-0.26.0
>
>
> The AMQP spec defines some frame fields as "multiple".
> [http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#section-composite-type-representation]
> "The _multiple_ attribute of a field description controls whether multiple element values
are permitted in the representation. A single element of the type specified in the field description
is always permitted. Multiple values are represented by the use of an array where the type
of the elements in the array is the type defined in the field definition. Note that a null
value and a zero-length array (with a correct type for its elements) both describe an absence
of a value and MUST be treated as semantically identical. "
> Proton accepts all legal values. This issue is to normalize values written by proton:
>  * empty array becomes null
>  * array of one element becomes a single value
> This is the most efficient encoding, and some clients (.NET) have problems with multiple
fields that contain an empty array rather than a null.



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

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


Mime
View raw message