[jira] [Commented] (PROTON-1498) [C++ binding] Message annotation_map works as value, but not as ref

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[jira] [Commented] (PROTON-1498) [C++ binding] Message annotation_map works as value, but not as ref

JIRA jira@apache.org

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

ASF subversion and git services commented on PROTON-1498:

Commit cb91969f3cbd14f7d01e831a45d8d1ccaa19b1f6 in qpid-proton's branch refs/heads/master from [~aconway]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=cb91969 ]

PROTON-1498:  Message annotation_map works as value, but not as ref

Already fixed by previous commits, added a regression test.

> [C++ binding] Message annotation_map works as value, but not as ref
> -------------------------------------------------------------------
>                 Key: PROTON-1498
>                 URL: https://issues.apache.org/jira/browse/PROTON-1498
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: cpp-binding
>            Reporter: Kim van der Riet
>            Assignee: Alan Conway
> When fetching a known message annotation from a message {{msg}} which has type {{uint8_t}}, the following call fails:
> {code}
> uint8_t t = msg.message_annotations().get(proton::symbol("x-opt-jms-msg-type")).get<int8_t>();
> {code}
> with {{proton::conversion_error}} "no more data".
> It appears that if the {{annotation_map}} is used as a reference rather than as a value, then this error occurs. If a local copy of the {{annotation_map}} is created, then the {{get()}} calls work ok.
> To test this, the above call was broken out as follows:
> {code}
> proton::message::annotation_map& am_ref = msg.message_annotations();
> uint8_t t = am_ref.get(proton::symbol("x-opt-jms-msg-type")).get<int8_t>();
> {code}
> fails as before, but
> {code}
> proton::message::annotation_map am_val = msg.message_annotations();
> uint8_t t = am_val.get(proton::symbol("x-opt-jms-msg-type")).get<int8_t>();
> {code}
> works ok.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]