Declare passive queue but also get the queue object
See original GitHub issueI’m migrating to net 5.0 and moving away from the 2.x version of this lib. Is there a way to replace these calls with something similar?
// passive, throws exception if queue not found.
_queue = _bus.Bus.QueueDeclare(_config.QueueInfo.Name, true);
I’m asking because I’ve found that there is QueueDeclarePassive, but it has a void return type.
// create queue
_queue = _bus.Bus.QueueDeclare(
name: _config.QueueInfo.Name,
passive: false,
durable: false,
exclusive: false,
autoDelete: _config.QueueInfo.AutoDelete,
perQueueMessageTtl: ttl,
maxLength: maxLen,
maxLengthBytes: maxMem);
How can I set the TTL and maxLength?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
RabbitMQ Failed to declare queue and Listener is not able ...
A RabbitAdmin is required to declare the queues/bindings; the container only does a passive declaration to check the queue is present.
Read more >com.rabbitmq.client.Channel.queueDeclarePassive java ...
public static boolean isQueueAvailable(Channel channel, String queueName) throws IOException { try { // check availability of the named queue // if an error ......
Read more >Queues
Declaring a queue will cause it to be created if it does not already exist. The declaration will have no effect if the...
Read more >Chapter 5. Don't get messages; consume them - RabbitMQ in ...
1 Connects to RabbitMQ; 2 Opens a channel on the connection; 3 Creates a new instance of a queue object to interact with...
Read more >Queue — rabbitpy 2.0.1 documentation - Read the Docs
The Queue class is used to work with RabbitMQ queues on an open channel. The following example shows how you can create a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I too was looking for a way to declare a queue passively.
This workaround helped me.
Of course, it isn’t really convenient. It seems the breaking change goes back to this PR https://github.com/EasyNetQ/EasyNetQ/pull/921
Hi @Sam-Lin-MillersLab,
QueueDeclarePassiveAsync only ensures that a queue with the provided name exists, therefore we still cannot construct a proper queue object, because do not know anything about the queue except its name.
#1678 only helps to fill in queue arguments.