I would like to know the correct way to access AMQP message properties through
Proton-C. If this the not the right mailing list for Proton-C usage queries, I
apologize and please direct me to the mailing list.
The scenario I have is an interop scenario where I send messages to a Windows
Azure Service Bus queue using the Service Bus .NET API, and I receive from
the queue using the Linux version of the Proton-C client ( Release 0.4 )
While sending messages I set some properties on AMQP message, and I want to get
those properties from the Proton-C receiver. The properties are simple key
value pairs where the Key is a string and the Value is an Int.
I would like to know how do I go about getting the properties from the received
pn_message_t
Here's what I am currently doing. But the mapsize is always 0.
pn_messenger_get(messenger, message);
pn_data_t *properties = pn_message_properties(message);
size_t mapsize = pn_data_get_map(properties);
int x=0;
for(x =0; x< mapsize/2; x++ )
{
printf("Property: %d\n",pn_data_get_int(properties));
}
If I enable frame level tracing in Proton-c by setting the PN_TRACE_FRM
environment variable I do see that the AMQP properties are making it over the
wire.
<- TRANSFER @20 [0, 0, b"\xe1\x11\xe7\x07$F\xb7E\xa55\xb1\x1b\x0f\xaf[\xdd", 0,
null, false, null, null, null, null, true] (252)
"\x00Sp\xc0\x07\x05@@@@R\x01\x00Sr\xc1U\x06\xa3\x13x-opt-enqueued-time\x83\x00\x00\x01=\x8f\xde\xe8\xae\xa3\x15x-opt-sequence-numberU\x01\xa3\x12x-opt-locked-until\x83\x00\x00\x01=\x8f\xdf\xdc&\x00Ss\xc0/\x0d\xa1
7d497616f2a54fb3b3a3b857443ac17c@@@@@@@@@@@@\x00St\xc1\x1d\x06\xa1\x05FirstT\x01\xa1\x06SecondT\x02\xa1\x05ThirdT\x03\x00Su\xa0;@\x03int\x083http://schemas.microsoft.com/2003/10/Serialization/\x81"
Can someone point me to the correct way to get to the AMQP message properties
or point me to a sample that does this.
Thanks,
Arun