PyRSMQ
PyRSMQ copied to clipboard
Implement get_transaction method on sendMessage
While we're dealing with transactions, I though it would be great to expose sendMessage transactions.
This would allow storing job data in redis and publishing it to consumers in one atomic transaction and avoid "orphan" jobs that may occur on producer failures with non atomic transactions.
Thanks for your contributions. It seems like it may be worthwhile to implement this pattern across all the transactions for sake of consistency and flexibility
Thanks for your contributions. It seems like it may be worthwhile to implement this pattern across all the transactions for sake of consistency and flexibility
Makes sense. However, this got me thinking: the transaction yielded here is somewhat non confusing - it uses the server time in the transaction creation, not execution. That's ok, but might be confusing, since the visibility timeout would be relative to that time, and not to the message send time. This is fine as long as you create the transaction right before you send it and prepares all the other actions ahead of time, but it's no very intuitive. That might also be the case in some other methods. I'm not sure what we should do here and whether this can be improved. Any thoughts?