packages feed

amqp 0.16.0 → 0.17.0

raw patch · 4 files changed

+17/−5 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Network/AMQP.hs view
@@ -5,7 +5,7 @@ --
 -- A good introduction to RabbitMQ and AMQP 0-9-1 (in various languages): <http://www.rabbitmq.com/getstarted.html>, <http://www.rabbitmq.com/tutorials/amqp-concepts.html>
 --
--- /Example/:
+-- == Example
 --
 -- Connect to a server, declare a queue and an exchange and setup a callback for messages coming in on the queue. Then publish a single message to our new exchange
 --
@@ -41,10 +41,18 @@ -- >    -- acknowledge receiving the message
 -- >    ackEnv env
 --
--- /Exception handling/:
+-- == Exception handling notes
 --
 -- Some function calls can make the AMQP server throw an AMQP exception, which has the side-effect of closing the connection or channel. The AMQP exceptions are raised as Haskell exceptions (see 'AMQPException'). So upon receiving an 'AMQPException' you may have to reopen the channel or connection.
-
+--
+-- == Debugging tips
+--
+-- If you need to debug a problem with e.g. channels being closed unexpectedly, here are some tips:
+--
+-- - The RabbitMQ log file often has helpful error-messages. The location of the log-file differs by OS. Look for RABBITMQ_LOGS in this page: <https://www.rabbitmq.com/relocate.html>
+-- - The function 'addChannelExceptionHandler' can be used to figure out when and why a channel was closed.
+-- - RabbitMQ has a browser-based management console, which allows you to see connections, channels, queues and more. Setup instructions are here: https://www.rabbitmq.com/management.html
+--
 module Network.AMQP (
     -- * Connection
     Connection,
Network/AMQP/Internal.hs view
@@ -565,7 +565,7 @@             )
     handleAsync (SimpleMethod (Channel_close _ (ShortString errorMsg) _ _)) = do
         closeChannel' chan errorMsg
-        myThreadId >>= flip CE.throwTo (ConnectionClosedException . T.unpack $ errorMsg)
+        myThreadId >>= flip CE.throwTo (ChannelClosedException . T.unpack $ errorMsg)
     handleAsync (SimpleMethod (Channel_flow active)) = do
         if active
             then openLock $ chanActive chan
amqp.cabal view
@@ -1,5 +1,5 @@ Name:                amqp
-Version:             0.16.0
+Version:             0.17.0
 Synopsis:            Client library for AMQP servers (currently only RabbitMQ)
 Description:         Client library for AMQP servers (currently only RabbitMQ)
 License:             BSD3
changelog.md view
@@ -1,3 +1,7 @@+### Version 0.17.0
+
+* When the server asynchronously closed a channel, this was (erroneously) internally represented as a `ConnectionClosedException`. It is now represented as a `ChannelClosedException`. This could affect you if you explicitly match on `ConnectionClosedException` or `ChannelClosedException` in your code, for example when using `addChannelExceptionHandler`.
+
 ### Version 0.16.0
 
 * new `coName` field in `ConnectionOpts` to specify a custom name that will be displayed in the RabbitMQ web interface