Open zhxsxuan opened 4 years ago
the py SDK does not support the binary message body. maybe you can encode the byte body using base64 encoding before sending and decode it before consuming. another way, you can try to add a new API to set a binary message body using a special C API "SetByteMessageBody" instead.
the py SDK does not support the binary message body. maybe you can encode the byte body using base64 encoding before sending and decode it before consuming. another way, you can try to add a new API to set a binary message body using a special C API "SetByteMessageBody" instead.
I tried changing the set_body function as following
def set_body(self, body):
if isinstance(body, binary_type):
ffi_check(dll.SetByteMessageBody(self._handle, _to_bytes(body), len(body)))
ffi_check(dll.SetMessageBody(self._handle, _to_bytes(body)))
But the message received was not changed.
Hi @ShannonDing, is there any further update on this issue? I tired a similar hack to @zhxsxuan above using SetByteMessageBody
, and also did not receive any sensible message.
I tried to send sync a byte string read from an image to RMQ by the following code:
but the message body a consumer received is only a part of the byte string