pulse: Support routing by exchange/topic, fixes #28.#32
Conversation
| self.got_message, | ||
| self.virtualhost, | ||
| ) | ||
| listeners = [ |
There was a problem hiding this comment.
I think it'd be better to have a single pulse connection, to reduce resource usage.
There was a problem hiding this comment.
So a single callback that find the good route from the message routing information ?
It would be more stable pulse-wise, but may lead to bugs if we have a message that matches multiple routes
There was a problem hiding this comment.
https://www.cloudamqp.com/blog/2018-01-19-part4-rabbitmq-13-common-errors.html suggests having one connection per process and one channel per thread.
Perhaps we could have one connection only, and one channel for each listener.
There was a problem hiding this comment.
Or you can use the exchange_name info from the envelope.
Or yet another option could be to use a consumer_tag in basic_consume (which will also be available in the envelope), so each consumer can be tagged.
| pulse = None | ||
| await asyncio.sleep(5) | ||
|
|
||
| def find_matching_queues(self, payload_exchange: str, payload_routes: List[bytes]): |
There was a problem hiding this comment.
It'd probably be better to use another of the solutions (especially the multiple channels one), but we can do it in a follow-up. Can you file it?
No description provided.