[rabbitmq-discuss] rabbitmq-c - Extracting message attributes / properties

Alan Antonuk alan.antonuk at gmail.com
Tue Nov 20 01:35:24 GMT 2012


The first frame you get when receiving a message is the basic.deliver
method frame.

Cast the amqp_frame_t.payload.method.decoded to an amqp_basic_deliver_t*,
then it will be in the routing_key member of that struct.  You can also get
the exchange and consumer tag that way.

-Alan

On Mon, Nov 19, 2012 at 1:53 PM, Daniel Hook <dhge at nym.hush.com> wrote:

> Thanks Alan.  One more thing.  How can I get the routing key of a received
> message?
>
> On Monday, November 19, 2012 12:22:19 PM UTC-5, Alan Antonuk wrote:
>
>> You want to cast the decoded void* pointer to a amqp_basic_properties_t*
>> pointer then you can access the properties.
>>
>> Note that this pointer is invalidated the next time you call
>> amqp_maybe_release_buffers, so be sure to copy anything you need out before
>> you call that function.
>>
>> -Alan
>>
>> On Mon, Nov 19, 2012 at 9:54 AM, Daniel Hook <dh... at nym.hush.com> wrote:
>>
>>> I can see clearly how to set the properties in amqp_basic_publish, but
>>> how does the consumer read them?  I think it relates to the void * decoded
>>> and amqp_bytes_t raw members of amqp_frame_t::properties, but I don't know
>>> how to interpret those pointers.
>>>
>>> Thanks.
>>>
>>> ______________________________**_________________
>>> rabbitmq-discuss mailing list
>>> rabbitmq... at lists.**rabbitmq.com
>>> https://lists.rabbitmq.com/**cgi-bin/mailman/listinfo/**rabbitmq-discuss<https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss>
>>>
>>>
>>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121119/83089a37/attachment.htm>


More information about the rabbitmq-discuss mailing list