What's Changed
* Migrating away from uamqp library: Till now, we were using the uamqp library as amqp 1.0 codec for the streaming protocol:
https://github.com/Azure/azure-uamqp-python.
This library (which is partially using cython) is not correctly compiling on ARM architectures (see
https://github.com/qweeze/rstream/issues/183)
Furthermore, it will be supported only til 2025 (https://github.com/Azure/azure-uamqp-python/issues/374)
We put some effort to integrating a new amqp 1.0 codec based on the work done here:
https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp
Which is a pure Python codec.
You can see the integration here:
https://github.com/qweeze/rstream/pull/194
The new codec creates a breaking change: The `body` field in the Producers is just a binary.
While before code like this was correct:
amqp_message = AMQPMessage(
body="hello: {}".format(i),
)
We now need to specify the body as binary (body is now indeed a list of bytes)
amqp_message = AMQPMessage(
body=bytes("hello: {}".format(i), "utf-8"),
)
Also, some imports may now be different. If you used MessageProperties before, for example:
import uamqp
message_properties = uamqp.message.MessageProperties("MessageId"+str(i), None, bytes("guest",'utf-8'), None, "CorrelationId"+str(i), "text/plain", "utf-8", None, None, None, None, 9999, "MyReplyToGroupId", None)
You now need to use the class exported on rstream like:
from rstream import Properties
message_properties = Properties(message_id="MessageId"+str(i), user_id=None, to=bytes("guest",'utf-8'), subject=None, correlation_id="CorrelationId"+str(i), content_type="text/plain", content_encoding="utf-8", absolute_expiry_time=None, creation_time=None, reply_to_group_id="MyReplyToGroupId")
There are also some benefits to this migration as performance seems overall better at around 10/15%