how to get headers from basicproperties list in python?

6 views
Skip to first unread message

Anthony Suh

unread,
Nov 19, 2012, 1:51:34 PM11/19/12
to rabbitmq...@googlegroups.com
Hello, I'm having trouble retrieving specific values (headers) from the basicproperties list.


def callback(ch, method, properties, body):

        #print " [x] Received %r" % (body,)

        f = open('/var/tmp/proto/sc2/delivery/TCG-proto','a+',0)

        f.write(body)

        f.write('\n')

        prop = properties

        print prop

        #print prop[1]

        #print prop[“headers”]

        #print prop.headers()

        print body

        test = raw_input("Enter Something: ")

I tried treating it like a dict or a method, but it errors.

I just want headers, is there a easier way?

Here's the pika doc: https://pika.readthedocs.org/en/latest/_modules/pika/spec.html#BasicProperties

Sorry I'm both a python and ampq novice. Any feedback or info is greatly appreciated.

Reply all
Reply to author
Forward
0 new messages