Skip to content
  • There are no suggestions because the search field is empty.

Regarding the use of passive, why do we need to set it to true?

Queues and exchanges can be declared “passively”. A passive declare simply checks that the entity with the provided name exists.
If it does, the operation is a no-op. For queues, successful passive declares will return the same information as non-passive ones, namely, the number of consumers and messages in a ready state in the queue. If the entity does not exist, the operation fails with a channel-level exception. The channel cannot be used after that; a new channel should be opened. It is common to use one-off (temporary) channels for passive declarations. Declaring the queue as passive therefore helps to avert redundant use of resources.