Bruno
Bruno

Reputation: 4665

RabbitMq direct queue that does not accumulate in "Ready" state?

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

Answers (1)

Bruno
Bruno

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

Related Questions