Open RonnyPixel opened 2 months ago
Great question. We'd need a PR! (I have no time to code, but I will review and cut a release if need be.)
This library uses pamqp under the hood. I think it might make sense to wrap (or expose) the pamqp Properties class, so properties could be passed as an optional parameter to publish(). It would go in the ContentHeader here https://github.com/CJWorkbench/carehare/blob/1ecbd99676256df3472b81968d5d325a44b19db4/carehare/_exchange_channel.py#L88.
My preference is wrapping the Properties class (i.e., creating a carehare.PublishProperties type that contains only the stuff we know we want). But I'd entertain exposing pamqp, maybe, if the rationale is strong.
Thank you for the quick response! It's a very nice lightweight API you have made, but I'm not so proficient in python so I think I'll just switch to pika then, it seems they have exposed properties=pika.BasicProperties(priority=i)) already
It seems publish(self, message: 'bytes', *, exchange_name: 'str' = '', routing_key: 'str' = '') only have these arguments, and from what I've read the priority is encoded in the message header not body so how can I send a message with a certain priority?