-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider adding a function that checks for exchange existence and is a predicate #60
Comments
@DrTom this is how RabbitMQ Java client works. We can add a new function but it will have to accept a connection (to create a one-off channel). In any case, it is often not necessary to use passive declares. Just declare what you need with the expected properties, and voilà. |
langohr-exchange/declare-passive
closes channel on IO Error
Not only that's how the Java client works: it is how the protocol works, and it is way too late to change that. |
OK, I keep my work-around then for the time being. |
Although, there is a number of very undesirable effects related to the channel closing. From the docs:
Now, if I use
So, all my consumers are not consuming any more from this point. |
@DrTom it's a pretty well known fact that passive declares should not be used on long-lived channels, and aren't necessary at all. What are your expectations? It's too late to change the protocol, the broker and all client libraries out there. The best we can do is to provide a new function and suggest that people use regular declares where they can. |
Yes. |
If
langohr-exchange/declare-passive
is used to find out about an non existing exchange it will throw an IO Error, if there is no such exchange. This is cumbersome, afalsy
return value would appear to me more useful.At any rate, it will also close the used channel and renders it useless:
com.rabbitmq.client.AlreadyClosedException: channel is already closed due to channel error; protocol ...
This behavior is very annoying; in particular in the context of automatic connection recovery etc.
This is true for langohr 3.0.0-rc3.
The text was updated successfully, but these errors were encountered: