我正在尝试使用 Qpid Proton 的 Python 绑定发送带有自定义属性的消息,但我找不到正确的方法......
message = Message()
message.body = u"hello body"
data = Data()
data.put_map()
data.enter()
data.put_string("key")
data.put_string("value")
data.exit()
message.properties = data
messenger.put(message)
messenger.send()
结果是...
Traceback (most recent call last):
File "./candy_ingest.py", line 37, in <module>
messenger.put(message)
File "/usr/lib/python2.7/dist-packages/proton.py", line 473, in put
message._pre_encode()
File "/usr/lib/python2.7/dist-packages/proton.py", line 781, in _pre_encode
props.put_object(self.properties)
File "/usr/lib/python2.7/dist-packages/proton.py", line 2036, in put_object
putter = self.put_mappings[obj.__class__]
KeyError: <class proton.Data at 0x2320420>
欢迎任何帮助!
TIA,托马斯。