You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rajith Attapattu (JIRA)" <ji...@apache.org> on 2012/05/29 15:17:23 UTC

[jira] [Commented] (QPID-4028) Expose message headers as raw bytes in the Qpid API

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

Rajith Attapattu commented on QPID-4028:
----------------------------------------

If we could add methods along the following lines, it would make the wrapper classes a lot more easy and also allow the binding to share data more efficiently.

Note the following is mainly for illustration purposes and I'm not insisting they should take the exact form.
I'm quite happy with something comparable but fits within the overall theme.

{code}

QPID_MESSAGING_EXTERN void setContentAsByteBuffer(const BYTE_BUFFER buf);
QPID_MESSAGING_EXTERN const BYTE_BUFFER getContentAsByteBuffer() const;

QPID_MESSAGING_EXTERN void setPropertiesAsByteBuffer(const BYTE_BUFFER buf);
QPID_MESSAGING_EXTERN const BYTE_BUFFER getPropertiesAsByteBuffer() const;

    struct QPID_MESSAGING_CLASS_EXTERN BYTE_BUFFER
    {
        public :
           QPID_MESSAGING_EXTERN BYTE_BUFFER(): start(0), size(0) {} 
           QPID_MESSAGING_EXTERN BYTE_BUFFER(char* p, long s) : start(p), size(s) {}
           QPID_MESSAGING_EXTERN char* getStart() const { return start; }
           QPID_MESSAGING_EXTERN long getSize() const { return size; }
        private:
           char* start;
           long  size;
    };
{code}
                
> Expose message headers as raw bytes in the Qpid API
> ---------------------------------------------------
>
>                 Key: QPID-4028
>                 URL: https://issues.apache.org/jira/browse/QPID-4028
>             Project: Qpid
>          Issue Type: New Feature
>          Components: C++ Client, Java Client
>            Reporter: Rajith Attapattu
>             Fix For: 0.17
>
>
> While this seems less useful for Ruby, Python, Perl clients to expose, there is a stronger case for the base clients like C/C++ and Java.
> When implementing the Java API over C++ via swig it was evident that if the Java client had accessed to the raw bytes instead of the processed qpid::sys::Variant types it would make the mapping a lot more easy and efficient.
> The extra copying and mapping of types is tedious, error prone and also quite inefficient.
> Exposing the raw bytes could allow the Java client to do the encoding and decoding by it self.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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