How to get basicproperties header field in pika python from rabbitmq messages?

def callback(ch, method, properties, body): prop = properties print prop #print prop[1] #print prop["headers"] #print prop.headers() print body 

This is a list from prop:

 <BasicProperties(['delivery_mode=2', "headers={'BIProto.ClickEvent': 'BIProto.ClickEvent'}", 'content_type=application/x-protobuf'])> 

I can print a body and a list of basic properties. But how can I get the headers?

All #print statements in the error-ed function.

+4
source share
1 answer

Nevermind, I only needed to print prop.headers

+9
source

Source: https://habr.com/ru/post/1447049/


All Articles