Since 1.8.0 the passive declaration is separated, taking only a name as
parameter and will not declare anything if the exchange or queue is not
there yet.
This does makes sense, so in theory, when wanting a passive declaration over
active, you would first try passive and then active.

Now the problem:

If passive declaration fails, it not only throws an exception, it also
closes the channel.

Questions:

- What is the added value of the Exchange.DeclareOk result?
- Why is there no API call available to check if an exchange exists (and
with which parameters) so that this exception can be prevented?

Cheers,
Irmo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100629/347cfe66/attachment.htm>

Search Discussions

  • Tony Garnock-Jones at Jul 1, 2010 at 1:55 am

    Irmo Manie wrote:
    This does makes sense, so in theory, when wanting a passive declaration
    over active, you would first try passive and then active.
    Well, another way of looking at it is to try active first, and never use
    passive :-) It will succeed if everything is copacetic, and otherwise it will
    close the channel with an error. Adding the call to passive doesn't actually
    buy you anything.

    Cheers,
    Tony
  • Matthias Radestock at Jul 7, 2010 at 10:54 am
    Irmo,
    On 29/06/10 08:44, Irmo Manie wrote:
    Since 1.8.0 the passive declaration is separated, taking only a name as
    parameter and will not declare anything if the exchange or queue is not
    there yet.
    This does makes sense, so in theory, when wanting a passive declaration
    over active, you would first try passive and then active.
    That is usually an anti-pattern since it's racy. Another client might
    create/remove the exchange after the passive declaration. Just actively
    declare the exchange instead.
    Now the problem:

    If passive declaration fails, it not only throws an exception, it also
    closes the channel.
    AMQP only has two kinds of errors - those that close that channel and
    those that close the connection. Channel creation/closure is quite cheap
    in rabbit, so the former type of errors are quite lightweight.

    Now, perhaps passive declaration should return a not-found response
    rather than a not-found error, but the protocol is what it is.
    Questions:

    - What is the added value of the Exchange.DeclareOk result?
    So you know that the operation has completed successfully.
    - Why is there no API call available to check if an exchange exists (and
    with which parameters) so that this exception can be prevented?
    As noted above, just perform an active declaration instead.

    I have yet to find a genuine use case for passive declarations. But the
    operations are defined in the protocol and quite easy to implement, so
    rabbit supports them.


    Regards,

    Matthias.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedJun 29, '10 at 7:44a
activeJul 7, '10 at 10:54a
posts3
users3
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2021 Grokbase