我试图发送一个消息使用Python Qpid质子结合自定义属性,但是我无法找到这样做的正确方法?
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()
Run Code Online (Sandbox Code Playgroud)
结果是...
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>
Run Code Online (Sandbox Code Playgroud)
欢迎任何帮助!
TIA,托马斯。
我想直接将Windows Azure Blob(图像)发送给客户端;我正在尝试:
blobService.getBlobToStream('images', req.url, res, function(err, blob) {
if (!err) {
res.writeHead(200, { 'Content-Type': blob.contentType });
} else {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(err);
}
});
Run Code Online (Sandbox Code Playgroud)
我试图将Blob流直接传递到响应流;这应该工作吗?在Firefox中,我收到一条消息:“由于包含错误,无法显示图像”。查看Firebug,图像大小为0。