How to add a header key:value pair when publishing a message with pika

后端 未结 3 461
独厮守ぢ
独厮守ぢ 2021-01-12 02:48

I am writing an automated test to test a consumer. So far I did not need to include a header when publishing messages but now I do. And it seems like its lacking documentati

3条回答
  •  长发绾君心
    2021-01-12 03:20

    The official document was mentioned as follows:

    hdrs = {u'': u' ',
        u'': u'',
        u'': u''}
    properties = pika.BasicProperties(app_id='example-publisher',
        content_type='application/json',  
        headers=hdrs)
    

提交回复
热议问题