Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 Kombu 发送文件和其他数据?我使用rabbitmq 作为经纪人。
例如 file.pdf 沿字典 {'author': 'user'}
如果可能的话,我想在一条消息中做到这一点。但是,如果您认为使用 Kombu 的标准序列化程序,您将如何绑定单独的消息?
有几种方法,但是如何:
producer.send({"author": "user", "file": file})
或者:
producer.send(file, serializer=None, headers={"author": "user"})
但是,标头只能是 AMQP 支持的类型。