Reputation: 4665
I would require a queue that does not accumulate in "Ready" state.
That is, if there is a subscriber to the queue, pass the messages from the exchange directly to it, and if there is no subscriber, just waste the messages, do not accumulate them in "Ready" state.
I know that an exchange of type fanout
does this, but I want to be able to use the routing key and a fanout
exchange ignores the routing keys. Moreove my scenario is not a broadcast one, it is 1 publisher and 1 (sometimes absent) subscriber.
Is it possible to have a direct exchange to which the queue does not accumulate messages in "ready" state if there is no subscriber?
Upvotes: 1
Views: 261
Reputation: 4665
ok I think I must declare the queue with auto-delete
to true
and set the mandatory
bit to true
on the BasicPublish
calls
it seems to work so far...
Upvotes: 1