Hi Andreas,

The x-amqp-foo output you see reported by the messaging API actually
correspond to message header values which are not the same thing as message
properties. There should be specific accessors on the message for all of
those fields, e.g. pn_message_get/set_creation_time(...).

--Rafael

On Fri, Dec 19, 2014 at 1:23 PM, Andreas Welchlin <andr...@welchlin.de>
wrote:
>
> Hello,
>
> I read AMQP messages using Proton 0.7 c-api which was sent via the Qpid
> C++ Message Broker (V0.28). I can read the message content and attributes
> like the correlation id or the user id with no problems. But it was not
> possible to read the properties of the message.
>
> The code:
>
> ------------------------------------------------------------
> ---------------
> pn_data_t * dataPtr = pn_message_properties(messagePtr);
> pn_data_next(dataPtr);
> if (pn_data_type(dataPtr) != PN_MAP)
>         printf("properties are no map\n"); // on the console it says that
> it is no map
>
> size_t mapsize = pn_data_get_map(dataPtr);
> pn_data_enter(dataPtr);
> for (int idx = 0; idx < mapsize/2; ++idx)
> {
>      printf("Property: %s\n", pn_data_get_string(dataPtr));
> }
> pn_data_exit(dataPtr);
> ------------------------------------------------------------
> ---------------
>
> The output:
>
> properties are no map
> mapsize: 0
>
>
> After the code above failed I tried:
>
> pn_data_dump(dataPtr);
>
> The output is also empty, is says:
>
> {current=0, parent=0}
>
>
>
> But when I use the Qpid C++ Messaging Api (V0.28)i to read the same
> message I get properties:
> ----------------------------------------------------------
> x-amqp-absolute-expiry-time..: 0
> x-amqp-creation-time..: 0
> x-amqp-first-acquirer..: True
> x-amqp-group-sequence..: 0
> x-amqp-message-annotations..: {qpid.msg_sequence:30}
> x-amqp-to..: amqp://127.0.0.1:5672/testtopic
> ----------------------------------------------------------
>
>
> So somehow I missed something but honestly I have no clue what I am doing
> wrong.
>
> Can someone give me a hint?
>
> Regards,
> Andreas
>
>
>
>
>
>

Reply via email to