2017-10-07 48 views

回答

4

看一看文档:

本节将介绍如何使用这里定义经纪人和用户属性:Message Headers and Properties

sent_msg = Message(b'This is the third message', 
       broker_properties={'Label': 'M3'}, 
       custom_properties={'Priority': 'Medium', 
            'Customer': 'ABC'} 
     ) 

在参考林k,你可以找到代理消息的ScheduledEnqueueTimeUtc属性,所以你可以这样设置:

sent_msg = Message(b'This is the third message', 
       broker_properties={'ScheduledEnqueueTimeUtc': datetime(2011, 12, 14)} 
     )