小编tom*_*nte的帖子

使用 Python 绑定在 Qpid Proton 中设置自定义消息属性

我试图发送一个消息使用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,托马斯。

python amqp qpid

5
推荐指数
1
解决办法
1431
查看次数

如何使用Node.js将Windows Azure Blob流传输到客户端?

我想直接将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。

azure node.js

2
推荐指数
1
解决办法
2694
查看次数

标签 统计

amqp ×1

azure ×1

node.js ×1

python ×1

qpid ×1