Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

fixed unencoded payload #151

Closed kammala closed 6 years ago

kammala commented 6 years ago

In case of decoded payload, which contains multi-byte unicode symbols, size of amqp message body calculates as count of unicode symbols in payload, while sending bytes, which count will be greater.

This PR fixes this behaviour by encoding payload in the beginning of publish.

Fixes #76

misuzu commented 6 years ago

Please, merge this one.

dzen commented 6 years ago

Hello @kammala @misuzu ;

I'm pretty sure it's not a way to deal with unencoded payloads:

According to the AMQP 0.9.1 documentation: The code MUST give bytes in here and fill the content_encoding property.

So we should accept this PR but add a warning to tell we will only accept bytes as payload.

dzen commented 6 years ago

I really advise you ton only submit bytes in here ;)

dzen commented 6 years ago

Closed with 09ec24d88a3fdf5848050a15352efd45cb92ac67