Closed srkimir closed 2 years ago
If you know that _setupRabbitTopology
will only be called with a fresh connection, I think it is safe. My reasoning is that a consumer's lifetime is scoped to the channel on which it's declared; so, if the channel goes away, which it will when the connection is closed, so does the consumer.
All the other declarations are idempotent; i.e., declaring things again won't create a new one.
A caveat: you can leak queues if you are declaring them without a name (which tells the server to make up a name for you). If you are doing this, also make them exclusive
, which will tie their lifetime to the connection as well.
This is more like a question, not an issue but i dont know where should i ask questions related to this package. If you take a look at
connect
function, on every successful connect/reconnect it will call_setupRabbitTopology
function which will assert exchanges, queues and which will subscribe consumer to a queue.So what im doing is creating reconnection logic that goes like this (please check
_setupRabbitTopology
function for question)