Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
Troubleshooting guide update: explain how to handle channel-level exc…
Browse files Browse the repository at this point in the history
…eptions and why it matters [ci skip]
  • Loading branch information
michaelklishin committed Aug 23, 2011
1 parent d9d7733 commit 037936c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/Troubleshooting.textile
Expand Up @@ -68,6 +68,32 @@ version 2.0 or later.
TBD TBD




h2. Handling channel-level exceptions

A broad range of problems result in AMQP channel exceptions: an indication by the broker that there was an issue application needs to be aware of.
Channel-level exceptions are typically not fatal and can be recovered from. Some examples are:

* Exchange is re-declared with attributes different from the original declaration. For example, a non-durable exchange is being re-declared as durable.
* Queue is re-declared with attributes different from the original declaration. For example, an autodeletable queue is being re-declared as non-autodeletable.
* Queue is bound to an exchange that does not exist.

and so on. When troubleshooting AMQP applications, it is recommended that you detect and handle channel-level exceptions on all channels your
application may use. For that, use {AMQP::Channel#on_error} method as demonstrated below:

<pre>
<code>
events_channel.on_error do |ch, channel_close|
puts "Channel-level exception on the events channel: #{channel_close.reply_text}"
end

commands_channel.on_error do |ch, channel_close|
puts "Channel-level exception on the commands channel: #{channel_close.reply_text}"
end
</code>
</pre>

Defining channel-level exception handlers will reveal many issues that it might take more time to detect using other troubleshooting techniques.



h2. Testing network connection with AMQP broker using Telnet h2. Testing network connection with AMQP broker using Telnet


Expand Down

0 comments on commit 037936c

Please sign in to comment.