I am adding a header key:value pair when publishing a message to my rabbitmq broker using pika like
channel.basic_publish(exchange=self.exchange,
routing_key=self.routing_key,
properties=pika.BasicProperties(
headers={'key': 'value'}
),
body=message)
On my client side I am subscribing the topic with Paho MQTT using websockets. How can I retrieve the same messages header using Paho MQTT . I have tried the following methods which doesn't work for me
def onMessage(client, userdata, message):
print("topic: " + message.topic + ", message: " + str(message.payload, 'utf-8'))
print(client.headers)
print(userdata.headers)
print(message.headers)
UPDATE
I have found that message has an Attribute 'properties'. But when I tried to print(message.properties)
it is giving AttributeError: properties
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…